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 johnnyisrael <jo...@gmail.com> on 2011/08/12 11:46:52 UTC

Fuzzy search with sort combination - drawback

Hi,

I am having one problem while using the fuzzy search from query.

I have two fields in my SOLR output, one field is endNgramed and other one
is a normal Integer field which will have my customized score for that
document.

I have a handler[myhandler] which by default will sort the documents based
on my customized score field and return the response.

Here I am trying fuzzy search sample query.

http://localhost:8080/solr/core0/select/?qt=myhandler&q=apple~0.7

I am getting the following result for the above query

	{
	 "Term":"tool academy application",
	 "MyScore":1152},
	{
	 "Term":"fiona apple",
	 "MyScore":928},
	{
	 "Term":"apple bottom jeans",
	 "MyScore":637},
	{
	 "Term":"apply for reality show",
	 "MyScore":606},
	{
	 "Term":"tool academy 3 application",
	 "MyScore":203}]
	 
	 
Here less relevant content has been coming on top [due to my customized
sort].

If I remove that sorting criteria and do the same search, I am getting the
following result.

	{
	 "Term":"fiona apple",
	 "MyScore":928},
	{
	 "Term":"apple bottom jeans",
	 "MyScore":637},
	{
	 "Term":"apply for reality show",
	 "MyScore":606},
	{
	 "Term":"tool academy application",
	 "MyScore":1152},
	{
	 "Term":"tool academy 3 application",
	 "MyScore":203}]
 },
 
Is there a way to achieve the customized sort as well as the relevant
content on top in this scenario.

Can anyone advice?

Thanks,

Johnny

--
View this message in context: http://lucene.472066.n3.nabble.com/Fuzzy-search-with-sort-combination-drawback-tp3248774p3248774.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Fuzzy search with sort combination - drawback

Posted by Erick Erickson <er...@gmail.com>.
I'm puzzled by what this means:

"Is there a way to achieve the customized sort as well as the relevant
content on top in this scenario."

You say you remove the sorting part, which means your results
are returned by relevance calculations. So I'm guessing that
a &debugQuery=on would show you that the relevance
calculations that Lucene is using are what's ordering your
results.

But sorting will completely override relevance calculations, which
is what you want it to do.

So can you explain a bit more what it is you're trying to accomplish?

Best
Erick

On Fri, Aug 12, 2011 at 5:46 AM, johnnyisrael <jo...@gmail.com> wrote:
> Hi,
>
> I am having one problem while using the fuzzy search from query.
>
> I have two fields in my SOLR output, one field is endNgramed and other one
> is a normal Integer field which will have my customized score for that
> document.
>
> I have a handler[myhandler] which by default will sort the documents based
> on my customized score field and return the response.
>
> Here I am trying fuzzy search sample query.
>
> http://localhost:8080/solr/core0/select/?qt=myhandler&q=apple~0.7
>
> I am getting the following result for the above query
>
>        {
>         "Term":"tool academy application",
>         "MyScore":1152},
>        {
>         "Term":"fiona apple",
>         "MyScore":928},
>        {
>         "Term":"apple bottom jeans",
>         "MyScore":637},
>        {
>         "Term":"apply for reality show",
>         "MyScore":606},
>        {
>         "Term":"tool academy 3 application",
>         "MyScore":203}]
>
>
> Here less relevant content has been coming on top [due to my customized
> sort].
>
> If I remove that sorting criteria and do the same search, I am getting the
> following result.
>
>        {
>         "Term":"fiona apple",
>         "MyScore":928},
>        {
>         "Term":"apple bottom jeans",
>         "MyScore":637},
>        {
>         "Term":"apply for reality show",
>         "MyScore":606},
>        {
>         "Term":"tool academy application",
>         "MyScore":1152},
>        {
>         "Term":"tool academy 3 application",
>         "MyScore":203}]
>  },
>
> Is there a way to achieve the customized sort as well as the relevant
> content on top in this scenario.
>
> Can anyone advice?
>
> Thanks,
>
> Johnny
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Fuzzy-search-with-sort-combination-drawback-tp3248774p3248774.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>