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 syegorius <su...@gmail.com> on 2016/08/02 13:57:34 UTC
how to sort search results by count matches
I have 4 records index by Solr:
1 hello planet dear friends
2 hello world dear friends
3 nothing
4 just friends
I'm searching with this query:
select?q=world+dear+friends&wt=json&indent=true
The result is:
1 hello planet dear friends
2 hello world dear friends
4 just friends
But as you can see first record has 2 matches, second - 3 and fourth - 1 and
i need the sequence of the result was:
2 hello world dear friends //3 matches
1 hello planet dear friends //2 matches
4 just friends//1 match
How can i do that?
--
View this message in context: http://lucene.472066.n3.nabble.com/how-to-sort-search-results-by-count-matches-tp4290022.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: how to sort search results by count matches
Posted by syegorius <su...@gmail.com>.
2016-08-02 17:12 GMT+03:00, syegorius [via Lucene]
<ml...@n3.nabble.com>:
>
>
> no. this is just just an example. i need some formula or some statement to
> sort results by count matches. everything i wrote was for you to best
> understand my problem
>
>
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://lucene.472066.n3.nabble.com/how-to-sort-search-results-by-count-matches-tp4290022p4290027.html
>
> To unsubscribe from how to sort search results by count matches, visit
> http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4290022&code=c3VwZXJ5ZWdvcml1c0BnbWFpbC5jb218NDI5MDAyMnwyMTExMjcyNzE=
--
View this message in context: http://lucene.472066.n3.nabble.com/how-to-sort-search-results-by-count-matches-tp4290022p4290028.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: how to sort search results by count matches
Posted by syegorius <su...@gmail.com>.
no. this is just just an example. i need some formula or some statement to
sort results by count matches. everything i wrote was for you to best
understand my problem
--
View this message in context: http://lucene.472066.n3.nabble.com/how-to-sort-search-results-by-count-matches-tp4290022p4290027.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: how to sort search results by count matches
Posted by Michael Kuhlmann <ku...@solr.info>.
Hi syegorius,
are you sure that there's no synonym "planet,world" defined?
-Michael
Am 02.08.2016 um 15:57 schrieb syegorius:
> I have 4 records index by Solr:
>
> 1 hello planet dear friends
> 2 hello world dear friends
> 3 nothing
> 4 just friends
>
> I'm searching with this query:
>
> select?q=world+dear+friends&wt=json&indent=true
>
> The result is:
>
> 1 hello planet dear friends
> 2 hello world dear friends
> 4 just friends
>
> But as you can see first record has 2 matches, second - 3 and fourth - 1 and
> i need the sequence of the result was:
>
> 2 hello world dear friends //3 matches
> 1 hello planet dear friends //2 matches
> 4 just friends//1 match
>
> How can i do that?
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/how-to-sort-search-results-by-count-matches-tp4290022.html
> Sent from the Solr - User mailing list archive at Nabble.com.
Re: how to sort search results by count matches
Posted by Mikhail Khludnev <mk...@apache.org>.
tfidf especially unreliable for such microindexes.
&debugQuery=true can explain why exactly.
On Tue, Aug 2, 2016 at 4:57 PM, syegorius <su...@gmail.com> wrote:
> I have 4 records index by Solr:
>
> 1 hello planet dear friends
> 2 hello world dear friends
> 3 nothing
> 4 just friends
>
> I'm searching with this query:
>
> select?q=world+dear+friends&wt=json&indent=true
>
> The result is:
>
> 1 hello planet dear friends
> 2 hello world dear friends
> 4 just friends
>
> But as you can see first record has 2 matches, second - 3 and fourth - 1
> and
> i need the sequence of the result was:
>
> 2 hello world dear friends //3 matches
> 1 hello planet dear friends //2 matches
> 4 just friends//1 match
>
> How can i do that?
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/how-to-sort-search-results-by-count-matches-tp4290022.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
--
Sincerely yours
Mikhail Khludnev