On Friday, July 20, 2012 10:03:04 AM UTC+2, Yiu Wing TSANG wrote:
I have some questions about analyzer:
- How can we we check which the analyzer is used in analyzing each
field during indexing?
check your field mapping if you didn't provide any mapping for the field
standard should be used for both indexing and searching.
you can explicitly define a search / index analyzer in the mapping per
"index_analyzer" : "standard",
"search_analyzer" : "your_super_smart_analyzer"
- by checking the QueryStringQueryBuilder, the default analyzer used
is "smart search analyzer" and so I have this problem:
the query string contains some words that are not be stripped away by
"smart search analyzer" but the words are stripped away by the
"default" analyzer used to index and analyze the fields, that leads to
searching for some words will yield no result
just use your smart analyzer at index and search time or the other way
and I tried to set the QueryStringQueryBuilder to "standard" (I just
guessed the default analyzer is standard, that's why I asked the
question 1 above) and I can search the result
so, is there any problem to change from "smart" to "standard" analyzer?
if you change the the query side analyzer to be the same as the index time
analyzer you don't have any problems i'd say. if you have different
analyzers at search and index time you just need to make sure they are
compatible. ie. you can use synonyms at query time OR at index time and
keep the rest of the analyzer the same. does that make sense?
or is there any documentation that can help to understand the logic of
you can check the lucene documenation for analyzers ie. java books or read
lucene in action (good reading anyway) there is no tutorial like
documentation for it around. (at least that I know of)