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 solr user <mv...@gmail.com> on 2012/01/23 17:54:36 UTC

Limiting term frequency in a document to a specific term

0 down vote favorite
share [fb] share [tw]


What is the proper query URL to limit the term frequency to just one term
in a document?

Below is an example query to search for the term frequency in a document,
but it is returning the frequency for all the terms.

[
http://localhost:8983/solr/select/?fl=documentPageId&q=documentPageId:49667.3&qt=tvrh&tv.tf=true&tv.fl=contents][1
]

I would like to be able to limit the query to just one term that I know
occurs in the document. The documentation for Term Frequency said to
specify the following:

   f.fieldName.tv.tf - Turns on Term Frequency for the fieldName specified.

This is in the wiki documentation:
http://wiki.apache.org/solr/TermVectorComponent

I tried various combinations of the above for the term amplifier in the URL
but I could not get it to work. I would appreciate the appropriate syntax
for a specific term amplifier.

Re: Limiting term frequency in a document to a specific term

Posted by Erick Erickson <er...@gmail.com>.
At a guess, you're using 3.x and the relevance functions are only
on trunk (4.0).

Best
Erick

On Tue, Jan 24, 2012 at 7:49 AM, solr user <mv...@gmail.com> wrote:
> With the Solr search relevancy functions, a ParseException, unknown
> function ttf in FunctionQuery.
>
> http://localhost:8983/solr/select/?fl=score,documentPageId&defType=func&q=ttf(contents,amplifiers)
>
> where contents is a field name, and amplifiers is text in the field name.
>
> Just curious why I get a parse exception for the above syntax.
>
>
>
>
> On Monday, January 23, 2012, Ahmet Arslan <io...@yahoo.com> wrote:
>>> Below is an example query to search for the term frequency
>>> in a document,
>>> but it is returning the frequency for all the terms.
>>>
>>> [
>>>
> http://localhost:8983/solr/select/?fl=documentPageId&q=documentPageId:49667.3&qt=tvrh&tv.tf=true&tv.fl=contents][1
>>> ]
>>>
>>> I would like to be able to limit the query to just one term
>>> that I know
>>> occurs in the document.
>>
>> I don't fully follow but http://wiki.apache.org/solr/FunctionQuery#tf may
> be what you want?
>>

Re: Limiting term frequency in a document to a specific term

Posted by solr user <mv...@gmail.com>.
With the Solr search relevancy functions, a ParseException, unknown
function ttf in FunctionQuery.

http://localhost:8983/solr/select/?fl=score,documentPageId&defType=func&q=ttf(contents,amplifiers)

where contents is a field name, and amplifiers is text in the field name.

Just curious why I get a parse exception for the above syntax.




On Monday, January 23, 2012, Ahmet Arslan <io...@yahoo.com> wrote:
>> Below is an example query to search for the term frequency
>> in a document,
>> but it is returning the frequency for all the terms.
>>
>> [
>>
http://localhost:8983/solr/select/?fl=documentPageId&q=documentPageId:49667.3&qt=tvrh&tv.tf=true&tv.fl=contents][1
>> ]
>>
>> I would like to be able to limit the query to just one term
>> that I know
>> occurs in the document.
>
> I don't fully follow but http://wiki.apache.org/solr/FunctionQuery#tf may
be what you want?
>

Re: Limiting term frequency in a document to a specific term

Posted by Ahmet Arslan <io...@yahoo.com>.
> Below is an example query to search for the term frequency
> in a document,
> but it is returning the frequency for all the terms.
> 
> [
> http://localhost:8983/solr/select/?fl=documentPageId&q=documentPageId:49667.3&qt=tvrh&tv.tf=true&tv.fl=contents][1
> ]
> 
> I would like to be able to limit the query to just one term
> that I know
> occurs in the document. 

I don't fully follow but http://wiki.apache.org/solr/FunctionQuery#tf may be what you want?