You need to use a shingle filter at index time so that pairs of adjacent words get indexed as single terms, then you can do a term frequency for the shingled pair of terms ("Research Development" as a single term). Be sure to manually apply any other filters, such as lower case or stemming.

See:
http://lucene.apache.org/core/4_7_0/analyzers-common/org/apache/lucene/analysis/shingle/ShingleFilterFactory.html
http://lucene.apache.org/core/4_7_0/analyzers-common/org/apache/lucene/analysis/shingle/ShingleFilter.html

But, note that you don't need to do any of this if you simply want to boost documents containing a phrase - just use the pf, pf2, and pf3 parameters of edsimax or explicitly boost the phrase, such as "research development"^20.

-- Jack Krupansky

-----Original Message----- From: ksmith
Sent: Saturday, April 26, 2014 5:38 AM
To: solr-user@lucene.apache.org
Subject: Re: get term frequency, just only keywords search

Hi, jack
i have a same problem as danielitos85
i want to search like "research development" but termfreq function not work
as per your messages
and you said that use phraseFreq but we can get it from debug query.
my problem is i want to sort on "research development" count, higher count
document will display first in list.
so how can i sort on that.
can you please help me asap.

Thanks.



--
View this message in context: http://lucene.472066.n3.nabble.com/get-term-frequency-just-only-keywords-search-tp4084510p4133260.html Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to