Mark Miller wrote:
vladimirneu wrote:
Thank you Mark!

Do you know the name of this special analyzer? (The link to Lucene API is
attached:
http://hudson.zones.apache.org/hudson/view/Lucene/job/Lucene-trunk/javadoc/
)

It would be very helpful for us. We are working with material in 12
different slavic languages (plus some West European languages) and would
like to unify our search (as far as possible). The ASCIIFoldingFilterFactory or ISOLatin1AccentFilterFactory works very fine for this purpose, but the problem is, the very powerfull query syntax possibilities of Lucene/Solr are
getting lost. Any suggestion how to solve this problem are welcomed.

Vladimir



Wildcard queries are not analyzed, so you are getting what you type - which doesnt match what went through an analyzer and into the index. I don't think Solr has a solution for this at the moment. I think Lucene has a special analyzer with deals with this to some degree, but I have never used it.


Right here:
http://lucene.apache.org/java/2_4_1/api/org/apache/lucene/queryParser/analyzing/AnalyzingQueryParser.html

It actually overrides the QueryParser - It appears to have some limitations though (as I'm sure any solution for this will have) - perhaps it could be improved upon. I'd be happy to help integrate it into Solr if we find that it can work well.

Hmm - not so sure it would clean fit Solr yet. Though I would love to have some form of this built in...

For now, I'd recommend making your own QParserPlugin if you can swing it: http://wiki.apache.org/solr/SolrPlugins#head-60a8c7a0663bd05a528899e7719ffe52522a21c2

You can essentially copy LuceneQParserPlugin from Solr, but instead of using SolrQueryParser, copy that and make your own. Just like AnalyzingQueryParser, SolrQueryParser overrides getPrefixQuery, getRangeQuery, getWildcardQuery. Override them with the implementations from AnalyzingQueryParser. Or something close to those implementations. You will likely run into issues with rangequery at least - Solr let fields themselves return the range query, so probably something like trie query will not work unless you put in some code to either call the field parser if its not an analzyed field, else do the AnalyzingQueryParser stuff. Look at the current impls, and kind of mix with the impls from AnalyzingQueryParser. Keep the getFieldQuery impl from SolrQueryParser.

Then you can just throw the plugin classes in the {solr.home}/lib dir and wire it up in solrconfig (or so the wiki says - not always update to date (or correct), that wiki).

--
- Mark

http://www.lucidimagination.com



Reply via email to