You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Michael Lissner <ml...@michaeljaylissner.com> on 2012/01/09 09:21:35 UTC
Missing query operators?
Hi,
I'm setting up a search system that I expect lawyers to use, and I know
they're demanding about the query operators they want. I've been looking
around a bit, and while some of these are possible on the backend, I
can't see how to enable them on the front end since they lack operators:
- exact match (disabling stemming): Ideally, users need a way of
turning this on or off for terms in their query (e.g. [ =walking running
] would stem the word running, but not walking).
- term quorum: This can be done via the mm parameter, but not as part
of a query. Making it part of the query increases the flexibility of the
parameter, since users can make queries like [ (dog cat kitten)/2 AND
goat ], which could request documents containing two of dog, cat or
kitten, as well as goat.
- term order: Requesting that one term come before another doesn't
seem to be possible, but can be very useful in some cases.
These are all possible in the Sphinx search engine, which is what I'm
coming from, and I don't see feature requests for them in Jira. Would it
be worth it to put these in, or is there a reason that Solr/Lucene don't
currently support these functions within queries?
Thanks,
Mike
Re: Missing query operators?
Posted by Tomás Fernández Löbbe <to...@gmail.com>.
Hi Mike,
> - exact match (disabling stemming): Ideally, users need a way of turning
> this on or off for terms in their query (e.g. [ =walking running ] would
> stem the word running, but not walking).
>
Correct, there is no way to do this with Solr just by
activating/deactivating one parameter. You could implement it very easily
by using two fields, one with and one without Stemming, I don't know how
this is implemented in Sphynx.
> - term quorum: This can be done via the mm parameter, but not as part of
> a query. Making it part of the query increases the flexibility of the
> parameter, since users can make queries like [ (dog cat kitten)/2 AND goat
> ], which could request documents containing two of dog, cat or kitten, as
> well as goat.
>
That's right, this is not a supported syntax. You could investigate nested
queries, I think those might help you but I doubt you can expect a user to
type those. See
http://www.lucidimagination.com/blog/2009/03/31/nested-queries-in-solr/
> - term order: Requesting that one term come before another doesn't seem
> to be possible, but can be very useful in some cases.
>
You may want to investigate Span Queries.
http://www.lucidimagination.com/blog/2009/07/18/the-spanquery/ and Solr's
support for them.
>
> These are all possible in the Sphinx search engine, which is what I'm
> coming from, and I don't see feature requests for them in Jira. Would it be
> worth it to put these in, or is there a reason that Solr/Lucene don't
> currently support these functions within queries?
>
> Thanks,
>
> Mike
>