You can use query slop as others have said to find documents with "my"
and "love" right next to each other, in any order. And I think query
slop can probably work for three or more words too to do that.
But it won't find files with ONLY those words in it. For instance "my
love"~2 will still match:
love my something else
something my love else
other love my
etc.
Solr isn't so good at doing "exact" matches in general, although there
are some techniques to set up your index and queries to do actual
"exact" (entire field) matches -- mostly putting fake tokens like
"$BEGIN" and "$END" at the beginning and end of your indexed values, and
then doing a phrase search which puts those tokens at begin and end too.
But I'm not sure if you can extend that technique to find exactly the
words in _any_ order, instead of just the exact exact phrase. Maybe
somehow using phrase slop? It gets confusing to think about, I'm not sure.
On 3/24/2011 10:52 AM, Gastone Penzo wrote:
no beacuse i don't know the words i want to ignore.. and i don't want use
dismax.
i have to use standard handler.
the problem is very simple. i want to recive only documents that have in
title field ONLY the words i search,
in any order.
if i search "my love darling", i want solr returns me these possilbe titles:
title1: my love darling
title2: my darling love
title3: darling my love
title4: love my darling
.....
all the combinations of these 3 words. others words have to be ignored
thanx
2011/3/24 Bill Bell<billnb...@gmail.com>
Yes create qt with dismax and qf on field that has query stopwords for the
words you want to ignore.
Bill Bell
Sent from mobile
On Mar 24, 2011, at 7:58 AM, Gastone Penzo<gastone.pe...@gmail.com>
wrote:
Hi,
is it possible with standard query search (not dismax) to have
exact matches that allow any terms order?
for example:
if i search "my love" i would solr gives to me docs with
- my love
- love my
it's easy: q=title:(my AND love)
the problem is it returns also docs with
"my love is my dog"
i don't want this. i want only docs with title formed by these 2 terms:
my
and love.
is it possible??
thanx
--
Gastone Penzo
*www.solr-italia.it*
*The first italian blog about Apache Solr*