I have a field that contains the full address, e.g. 1200 S FUN ST.
I need to accomplish two type of searches one a suggest search with
synonyms so that users can type ahead "1200 Fun ave" which can be "1200 Fun
Avenue" or "1200 E Fun Ave". How have other accomplished this type of
search and what type of tokenizing needs to be used?
One my second type is more of a full text exact search but my search
results don't match correctly. I 1st setup the field fullAddress as a
"string" map:
fullAddress:
{
type: "string"
},
When I query for say Fun St I get results that include S Fun St and N Fun
St and plain Fun St.
"text": {
"fullAddress": "Fun St"
}
However, when I then try to search for "S Fun St" it result also results
with "Fun St" and other addresses with "S" in it.
"text": {
"fullAddress": "S Fun St"
}
From reading some other posts they suggest using a mapping where the field
is not analyzed. So I changed the field to the following:
fullAddress:
{
type: "string",
index: "not_analyzed",
omit_norms: true,
index_options: "docs"
},
But now when I do the query I don't get any results unless the I do an
exact query that does a complete match. Any thoughts?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.