Re: Search for All CAPS words
Took me a while but I tried it and its works perfectly. Thanks a lot !! Ritesh -- View this message in context: http://lucene.472066.n3.nabble.com/Search-for-All-CAPS-words-tp4219893p4221597.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Search for All CAPS words
So, what you want is to duplicate a specific token, rename one of the copies, and inject it with the same offset as the original. So GATE => gate, _gate but gate=>gate. That, to me, is a custom token filter. You can probably use KeywordRepeatFilterFactory as a base: http://www.solr-start.com/javadoc/solr-lucene/org/apache/lucene/analysis/miscellaneous/KeywordRepeatFilterFactory.html (you can click through to the Filter and then source from there). Regards, Alex. Solr Analyzers, Tokenizers, Filters, URPs and even a newsletter: http://www.solr-start.com/ On 30 July 2015 at 13:53, rks_lucene wrote: > Thanks and I did think of the copy field option. So what you are suggesting > is that I have a copyfield in which I do not keep the lowercase factory > analyzer in my indexing/query chains. > > I am afraid that would not help if my search query is complex with many > words (say a boolean with proximity operators) because the full search > string would have go into the copyfield (not having the lowercase). The rest > of the words other than /GATE/ wouldnt match properly then. > > Ritesh > > > > > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Search-for-All-CAPS-words-tp4219893p4219959.html > Sent from the Solr - User mailing list archive at Nabble.com.
Re: Search for All CAPS words
Thanks and I did think of the copy field option. So what you are suggesting is that I have a copyfield in which I do not keep the lowercase factory analyzer in my indexing/query chains. I am afraid that would not help if my search query is complex with many words (say a boolean with proximity operators) because the full search string would have go into the copyfield (not having the lowercase). The rest of the words other than /GATE/ wouldnt match properly then. Ritesh -- View this message in context: http://lucene.472066.n3.nabble.com/Search-for-All-CAPS-words-tp4219893p4219959.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Search for All CAPS words
Have you tried copyField with different field type for different fields yet? That would be my first step. Make the copied field indexed-only, not stored for efficiency. And you can then either search against that copied field directly or use eDisMax against both fields and give that field a higher priority. Regards, Alex. Solr Analyzers, Tokenizers, Filters, URPs and even a newsletter: http://www.solr-start.com/ On 30 July 2015 at 10:00, rks_lucene wrote: > Hi, > > I need the capability to search for /GATE/ separately from /gate/. > > I cannot remove the lowercase filter factory in both my search and analysis > chains since that will break many other search scenarios. > > Is there a way to payload/mark an ALL CAPS word in the index analyzer chain > before it gets lowercased (by the lowercasefilterfactory) so that I can > search it with some custom grammar and logic in my query parser. > > Say I want: > > Field:_gate to match /GATE/ only > > Field:gate to match both /GATE/ and /gate/ > > Any pointers would be helpful. > > thanks > Ritesh > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Search-for-All-CAPS-words-tp4219893.html > Sent from the Solr - User mailing list archive at Nabble.com.
Search for All CAPS words
Hi, I need the capability to search for /GATE/ separately from /gate/. I cannot remove the lowercase filter factory in both my search and analysis chains since that will break many other search scenarios. Is there a way to payload/mark an ALL CAPS word in the index analyzer chain before it gets lowercased (by the lowercasefilterfactory) so that I can search it with some custom grammar and logic in my query parser. Say I want: Field:_gate to match /GATE/ only Field:gate to match both /GATE/ and /gate/ Any pointers would be helpful. thanks Ritesh -- View this message in context: http://lucene.472066.n3.nabble.com/Search-for-All-CAPS-words-tp4219893.html Sent from the Solr - User mailing list archive at Nabble.com.