On 02/02/2012 07:27, Doron Cohen wrote:
In my particular case I add album catalogsno to my index as a
keyword field , but of course if the cat log number contains a
space as they often do (i.e. cad 6) there is a mismatch. Ive now
changed my indexing to index the value as 'cad6' removing spaces.
Now if the query sent to the query parser is just
cad 6
there is the issue that it breaks them up into two separate
fields , but I thought it that if the query sent to the parser was
"cad 6"
then the complete string would be passed using the analyzer , but
it doesn't seem to quite work, it creates a TermQuery instead of a
PhraseQuery , yet the explain shows the query to have the value
catno:cad 6
rather than
catno:cad6
and I dont get a match, what does that mean ?
Seems like at query time a KeywordAnalyzer was applied, while at
indexing time additional logic of removing spaces was (first) applied,
therefore the different results at indexing and search.
Doron
Hi, sort of I had an error in the reusableTokenStream() method of my
analyzer, so it wasn't doing the full analysis at query time, working now.
thanks Paul