tf function query

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

tf function query

Dmitry Kan-2
Hi,

According to
https://lucene.apache.org/solr/guide/6_6/function-queries.html#FunctionQueries-AvailableFunctions

tf(field, term) requires a term as a second parameter. Is there a
possibility to pass in an entire input query (multiterm and boolean) to the
function?

The context here is that we don't use edismax parser to apply multifield
boosts, but instead use a custom ranking function.

Would appreciate any thoughts,

Dmitry

--
Dmitry Kan
Luke Toolbox: http://github.com/DmitryKey/luke
Blog: http://dmitrykan.blogspot.com
Twitter: http://twitter.com/dmitrykan
SemanticAnalyzer: https://semanticanalyzer.info
Reply | Threaded
Open this post in threaded view
|

RE: tf function query

Junte Zhang
I am afraid this is not possible, since getting frequencies for phrases is not possible, unless the phrases are created as tokens (i.e. using n-grams or shingles) and indexed. If someone has a solution for this, then I am interested as well.

/JZ

-----Original Message-----
From: Dmitry Kan [mailto:[hidden email]]
Sent: Thursday, October 5, 2017 12:15 PM
To: [hidden email]
Subject: tf function query

Hi,

According to
https://lucene.apache.org/solr/guide/6_6/function-queries.html#FunctionQueries-AvailableFunctions

tf(field, term) requires a term as a second parameter. Is there a possibility to pass in an entire input query (multiterm and boolean) to the function?

The context here is that we don't use edismax parser to apply multifield boosts, but instead use a custom ranking function.

Would appreciate any thoughts,

Dmitry

--
Dmitry Kan
Luke Toolbox: http://github.com/DmitryKey/luke
Blog: http://dmitrykan.blogspot.com
Twitter: http://twitter.com/dmitrykan
SemanticAnalyzer: https://semanticanalyzer.info
Reply | Threaded
Open this post in threaded view
|

Re: tf function query

Erik Hatcher-4
In reply to this post by Dmitry Kan-2
How about the query() function?  Just be clever about the query you specify ;)

> On Oct 5, 2017, at 06:14, Dmitry Kan <[hidden email]> wrote:
>
> Hi,
>
> According to
> https://lucene.apache.org/solr/guide/6_6/function-queries.html#FunctionQueries-AvailableFunctions
>
> tf(field, term) requires a term as a second parameter. Is there a
> possibility to pass in an entire input query (multiterm and boolean) to the
> function?
>
> The context here is that we don't use edismax parser to apply multifield
> boosts, but instead use a custom ranking function.
>
> Would appreciate any thoughts,
>
> Dmitry
>
> --
> Dmitry Kan
> Luke Toolbox: http://github.com/DmitryKey/luke
> Blog: http://dmitrykan.blogspot.com
> Twitter: http://twitter.com/dmitrykan
> SemanticAnalyzer: https://semanticanalyzer.info
Reply | Threaded
Open this post in threaded view
|

Re: tf function query

Erick Erickson
In reply to this post by Dmitry Kan-2
What would you  expect as output? tf(field, "a OR b AND c NOT d"). I'm
not sure what term frequency would even mean in that situation.

tf is a pretty simple function, it expects a single term and there's
now way I know of to do what you're asking.

Best,
Erick

On Thu, Oct 5, 2017 at 3:14 AM, Dmitry Kan <[hidden email]> wrote:

> Hi,
>
> According to
> https://lucene.apache.org/solr/guide/6_6/function-queries.html#FunctionQueries-AvailableFunctions
>
> tf(field, term) requires a term as a second parameter. Is there a
> possibility to pass in an entire input query (multiterm and boolean) to the
> function?
>
> The context here is that we don't use edismax parser to apply multifield
> boosts, but instead use a custom ranking function.
>
> Would appreciate any thoughts,
>
> Dmitry
>
> --
> Dmitry Kan
> Luke Toolbox: http://github.com/DmitryKey/luke
> Blog: http://dmitrykan.blogspot.com
> Twitter: http://twitter.com/dmitrykan
> SemanticAnalyzer: https://semanticanalyzer.info
Reply | Threaded
Open this post in threaded view
|

Re: tf function query

Dmitry Kan-2
sorry guys to have not been responding & thanks a lot for answers.

@Erick Erickson: what I would ideally like to have is tf-idf value for
user's query. The thing is that we have two searchable fields. While boost
works just fine for one, there is no easy way to have it multiplied by
boost from another field (with current parser).

@Erik Hatcher: interesting idea, how have I missed it :) Is there a way to
capture the value and push it through to other field's boost function?

Thanks a bunch,

Dmitry

On Thu, Oct 5, 2017 at 4:53 PM, Erick Erickson <[hidden email]>
wrote:

> What would you  expect as output? tf(field, "a OR b AND c NOT d"). I'm
> not sure what term frequency would even mean in that situation.
>
> tf is a pretty simple function, it expects a single term and there's
> now way I know of to do what you're asking.
>
> Best,
> Erick
>
> On Thu, Oct 5, 2017 at 3:14 AM, Dmitry Kan <[hidden email]> wrote:
> > Hi,
> >
> > According to
> > https://lucene.apache.org/solr/guide/6_6/function-
> queries.html#FunctionQueries-AvailableFunctions
> >
> > tf(field, term) requires a term as a second parameter. Is there a
> > possibility to pass in an entire input query (multiterm and boolean) to
> the
> > function?
> >
> > The context here is that we don't use edismax parser to apply multifield
> > boosts, but instead use a custom ranking function.
> >
> > Would appreciate any thoughts,
> >
> > Dmitry
> >
> > --
> > Dmitry Kan
> > Luke Toolbox: http://github.com/DmitryKey/luke
> > Blog: http://dmitrykan.blogspot.com
> > Twitter: http://twitter.com/dmitrykan
> > SemanticAnalyzer: https://semanticanalyzer.info
>



--
Dmitry Kan
Luke Toolbox: http://github.com/DmitryKey/luke
Blog: http://dmitrykan.blogspot.com
Twitter: http://twitter.com/dmitrykan
SemanticAnalyzer: https://semanticanalyzer.info