lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aloke Ghoshal <alghos...@gmail.com>
Subject Re: Find documents that are composed of % words
Date Thu, 10 Oct 2013 13:15:38 GMT
Something you could do via function queries. Performance (for 500+ words)
is a doubtful.

1) With a separate float field (myfieldwordcount) that holds the count of
words from your query field (myfield):

http://localhost:8983/solr/collection1/select?wt=xml&indent=true&defType=func
&fl=id,myfield
&q={!frange l=0.75}div(sum(exists(query({!dismax qf=myfield
v='word1'})),exists(query({!dismax qf=myfield
v='word2'})),exists(query({!dismax qf=myfield
v='word3'}))),myfieldwordcount)

The value for myfieldwordcount will need to worked out externally and added
to Solr for every document.

2) Using field norm as an approximation for word count:*
*(Use default boost =1.0, see:
http://wiki.apache.org/solr/SolrRelevancyFAQ#index-time_boosts)
*
*
http://localhost:8983/solr/collection1/select?wt=xml&indent=true&defType=func
&fl=id,myfield
&q={!frange l=0.75}product(sum(exists(query({!dismax qf=myfield
v='word1'})),exists(query({!dismax qf=myfield
v='word2'})),exists(query({!dismax qf=myfield
v='word3'}))),norm(myfield),norm(myfield))

Regards,
Aloke


On Wed, Oct 9, 2013 at 7:21 PM, shahzad73 <shahzad_73@yahoo.com> wrote:

> Please help me formulate the query that will be easy or do i have to build
> a
> custom filter for this ?
>
> Shahzad
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Find-documents-that-are-composed-of-words-tp4094264p4094372.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message