DmitryKey / luke

This is mavenised Luke: Lucene Toolbox Project
Apache License 2.0
1.54k stars 352 forks source link

Ability to use custom QueryParsers #25

Open dustinschultz opened 9 years ago

dustinschultz commented 9 years ago

Hi,

Feature Request

There's already the ability to have custom analyzers but it'd be really nice if you could configure a custom QueryParser as well. Custom functionality often requires subclassing QueryParser and not being able to use it in Luke means resorting to not using Luke at all.

In addition, there are several supported versions of subclasses of QueryParser that are bundled with lucene (e.g. AnalyzingQueryParser)

Thanks, Dustin

DmitryKey commented 9 years ago

good point @dustinschultz . Luke allows for custom analyzers. See: https://github.com/DmitryKey/luke/blob/master/luke.sh

Adding support for query parsers sounds a logical feature along with custom analyzers. Will need to poke around the code and see how to do this.

Moddus commented 8 years ago

Hi everyone, i've tried to implement the functionality to specify a custom QueryParser. In the code I've found the Parameter '-xmlQueryParserFactory' but I've no idea how this parameter works. Could anyone give me some advice?

Thanks

DmitryKey commented 8 years ago

hi @Moddus !

Tracing the code, I see that it is the xml parser in lucene. Check the org.apache.lucene.queryparser.xml. Take a look at wiki: https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-XMLQueryParser

If you don't pass the command line option you mentioned, the default parser is going to be used: CorePlusExtensionsParser.

Moddus commented 8 years ago

Thanks @DmitryKey for your advice. I'm looking forward to make the QueryParser configurable.

DmitryKey commented 8 years ago

Exciting, thanks @Moddus

mocobeta commented 5 years ago

For contributors: Now Luke is a part of Apache Lucene. Please create an issue (if there is not exist) to Lucene Jira if you want to help with this.