luke icon indicating copy to clipboard operation
luke copied to clipboard

Ability to use custom QueryParsers

Open dustinschultz opened this issue 10 years ago • 6 comments

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

dustinschultz avatar Apr 23 '15 16:04 dustinschultz

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.

DmitryKey avatar Apr 24 '15 09:04 DmitryKey

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

Moddus avatar Jul 25 '16 11:07 Moddus

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.

DmitryKey avatar Jul 27 '16 07:07 DmitryKey

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

Moddus avatar Jul 27 '16 07:07 Moddus

Exciting, thanks @Moddus

DmitryKey avatar Jul 27 '16 08:07 DmitryKey

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.

mocobeta avatar Apr 15 '19 09:04 mocobeta