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 Arnold Bronley <ar...@gmail.com> on 2017/10/06 19:48:24 UTC
spell-check does not return collations when using search query with filter
When 'polt' is passed as keyword, both suggestions and collations
parameters are returned. But if I pass 'tag:polt' as search query then only
suggestions parameter is returned. Is this a bug?
Re: spell-check does not return collations when using search query
with filter
Posted by Arnold Bronley <ar...@gmail.com>.
With q instead of spellcheck.q I get following response:
{
"responseHeader": {
"status": 0,
"QTime": 23,
"params": {
"q": "tag:polt",
"spellcheck.collateExtendedResults": "true",
"indent": "true",
"spellcheck": "true",
"spellcheck.accuracy": "0.72",
"spellcheck.maxCollations": "3",
"spellcheck.onlyMorePopular": "true",
"spellcheck.count": "7",
"spellcheck.maxCollationTries": "3",
"wt": "json",
"spellcheck.extendedResults": "true",
"spellcheck.collate": "true"
}
},
"response": {
"numFound": 0,
"start": 0,
"docs": [
]
},
"spellcheck": {
"suggestions": [
"polt",
{
"numFound": 7,
"startOffset": 3,
"endOffset": 8,
"origFreq": 0,
"suggestion": [
{
"word": "plot",
"freq": 5934
},
{
"word": "port",
"freq": 495
},
{
"word": "post",
"freq": 233
},
{
"word": "poly",
"freq": 216
},
{
"word": "pole",
"freq": 175
},
{
"word": "poll",
"freq": 12
},
{
"word": "polm",
"freq": 9
}
]
}
],
"correctlySpelled": false,
"collations": [
]
}
}
with q and using the workaround that I mentioned, I get proper response as
follows (Note that I passed tag:\polt to q but in responseHeader, it shows
the escaped version i.e. tag:\\polt):
{
"responseHeader": {
"status": 0,
"QTime": 20,
"params": {
"q": "tag:\\polt",
"spellcheck.collateExtendedResults": "true",
"indent": "true",
"spellcheck": "true",
"spellcheck.accuracy": "0.72",
"spellcheck.maxCollations": "3",
"spellcheck.onlyMorePopular": "true",
"spellcheck.count": "7",
"spellcheck.maxCollationTries": "3",
"wt": "json",
"spellcheck.extendedResults": "true",
"spellcheck.collate": "true"
}
},
"response": {
"numFound": 0,
"start": 0,
"docs": [
]
},
"spellcheck": {
"suggestions": [
"polt",
{
"numFound": 7,
"startOffset": 4,
"endOffset": 9,
"origFreq": 0,
"suggestion": [
{
"word": "plot",
"freq": 5934
},
{
"word": "port",
"freq": 495
},
{
"word": "post",
"freq": 233
},
{
"word": "poly",
"freq": 216
},
{
"word": "pole",
"freq": 175
},
{
"word": "poll",
"freq": 12
},
{
"word": "polm",
"freq": 9
}
]
}
],
"correctlySpelled": false,
"collations": [
"collation",
{
"collationQuery": "tag:plot",
"hits": 703,
"misspellingsAndCorrections": [
"polt",
"plot"
]
},
"collation",
{
"collationQuery": "tag:port",
"hits": 8,
"misspellingsAndCorrections": [
"polt",
"port"
]
},
"collation",
{
"collationQuery": "tag:post",
"hits": 3,
"misspellingsAndCorrections": [
"polt",
"post"
]
}
]
}
On Mon, Oct 16, 2017 at 3:00 PM, Arnold Bronley <ar...@gmail.com>
wrote:
> with spellcheck.q I don't get anything back at all.
>
> {
> "responseHeader": {
> "status": 0,
> "QTime": 10,
> "params": {
> "spellcheck.collateExtendedResults": "true",
> "spellcheck.q": "tag:polt",
> "indent": "true",
> "spellcheck": "true",
> "spellcheck.accuracy": "0.72",
> "spellcheck.maxCollations": "3",
> "spellcheck.onlyMorePopular": "true",
> "spellcheck.count": "7",
> "spellcheck.maxCollationTries": "3",
> "wt": "json",
> "spellcheck.extendedResults": "true",
> "spellcheck.collate": "true"
> }
> },
> "response": {
> "numFound": 0,
> "start": 0,
> "docs": [
>
> ]
> },
> "spellcheck": {
> "suggestions": [
>
> ],
> "correctlySpelled": false,
> "collations": [
>
> ]
> }
> }
>
> On Mon, Oct 16, 2017 at 5:03 AM, alessandro.benedetti <
> a.benedetti@sease.io> wrote:
>
>> Interesting, what happens when you pass it as spellcheck.q=polt ?
>> What is the behavior you get ?
>>
>>
>>
>>
>>
>> -----
>> ---------------
>> Alessandro Benedetti
>> Search Consultant, R&D Software Engineer, Director
>> Sease Ltd. - www.sease.io
>> --
>> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>>
>
>
Re: spell-check does not return collations when using search query
with filter
Posted by Arnold Bronley <ar...@gmail.com>.
Let me know if I should open a JIRA issue for this. Thanks.
On Tue, Oct 17, 2017 at 10:40 AM, Arnold Bronley <ar...@gmail.com>
wrote:
> I tried spellcheck.q=polt and q=tag:polt. I get collations, but they are
> only for polt and not tag:polt. Because of that, the hits that I get back
> are for frequency of plot and not frequency of tag:plot
>
> {
> "responseHeader": {
> "status": 0,
> "QTime": 20,
> "params": {
> "spellcheck.collateExtendedResults": "true",
> "indent": "true",
> "spellcheck.maxCollations": "3",
> "spellcheck.maxCollationTries": "3",
> "spellcheck.extendedResults": "true",
> "q": "tag:polt",
> "spellcheck.q": "polt",
> "spellcheck": "true",
> "spellcheck.accuracy": "0.72",
> "spellcheck.onlyMorePopular": "true",
> "spellcheck.count": "7",
> "wt": "json",
> "spellcheck.collate": "true"
> }
> },
> "response": {
> "numFound": 0,
> "start": 0,
> "docs": [
>
> ]
> },
> "spellcheck": {
> "suggestions": [
> "polt",
> {
> "numFound": 7,
> "startOffset": 0,
> "endOffset": 4,
> "origFreq": 0,
> "suggestion": [
> {
> "word": "plot",
> "freq": 5934
> },
> {
> "word": "port",
> "freq": 495
> },
> {
> "word": "post",
> "freq": 233
> },
> {
> "word": "poly",
> "freq": 216
> },
> {
> "word": "pole",
> "freq": 175
> },
> {
> "word": "poll",
> "freq": 12
> },
> {
> "word": "polm",
> "freq": 9
> }
> ]
> }
> ],
> "correctlySpelled": false,
> "collations": [
> "collation",
> {
> "collationQuery": "plot",
> "hits": 10538,
> "misspellingsAndCorrections": [
> "polt",
> "plot"
> ]
> },
> "collation",
> {
> "collationQuery": "port",
> "hits": 754,
> "misspellingsAndCorrections": [
> "polt",
> "port"
> ]
> },
> "collation",
> {
> "collationQuery": "post",
> "hits": 626,
> "misspellingsAndCorrections": [
> "polt",
> "post"
> ]
> }
> ]
> }
> }
>
> On Tue, Oct 17, 2017 at 5:01 AM, alessandro.benedetti <
> a.benedetti@sease.io> wrote:
>
>> But you used :
>>
>> "spellcheck.q": "tag:polt",
>>
>> Instead of :
>> "spellcheck.q": "polt",
>>
>> Regards
>>
>>
>>
>> -----
>> ---------------
>> Alessandro Benedetti
>> Search Consultant, R&D Software Engineer, Director
>> Sease Ltd. - www.sease.io
>> --
>> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>>
>
>
Re: spell-check does not return collations when using search query
with filter
Posted by Arnold Bronley <ar...@gmail.com>.
I tried spellcheck.q=polt and q=tag:polt. I get collations, but they are
only for polt and not tag:polt. Because of that, the hits that I get back
are for frequency of plot and not frequency of tag:plot
{
"responseHeader": {
"status": 0,
"QTime": 20,
"params": {
"spellcheck.collateExtendedResults": "true",
"indent": "true",
"spellcheck.maxCollations": "3",
"spellcheck.maxCollationTries": "3",
"spellcheck.extendedResults": "true",
"q": "tag:polt",
"spellcheck.q": "polt",
"spellcheck": "true",
"spellcheck.accuracy": "0.72",
"spellcheck.onlyMorePopular": "true",
"spellcheck.count": "7",
"wt": "json",
"spellcheck.collate": "true"
}
},
"response": {
"numFound": 0,
"start": 0,
"docs": [
]
},
"spellcheck": {
"suggestions": [
"polt",
{
"numFound": 7,
"startOffset": 0,
"endOffset": 4,
"origFreq": 0,
"suggestion": [
{
"word": "plot",
"freq": 5934
},
{
"word": "port",
"freq": 495
},
{
"word": "post",
"freq": 233
},
{
"word": "poly",
"freq": 216
},
{
"word": "pole",
"freq": 175
},
{
"word": "poll",
"freq": 12
},
{
"word": "polm",
"freq": 9
}
]
}
],
"correctlySpelled": false,
"collations": [
"collation",
{
"collationQuery": "plot",
"hits": 10538,
"misspellingsAndCorrections": [
"polt",
"plot"
]
},
"collation",
{
"collationQuery": "port",
"hits": 754,
"misspellingsAndCorrections": [
"polt",
"port"
]
},
"collation",
{
"collationQuery": "post",
"hits": 626,
"misspellingsAndCorrections": [
"polt",
"post"
]
}
]
}
}
On Tue, Oct 17, 2017 at 5:01 AM, alessandro.benedetti <a....@sease.io>
wrote:
> But you used :
>
> "spellcheck.q": "tag:polt",
>
> Instead of :
> "spellcheck.q": "polt",
>
> Regards
>
>
>
> -----
> ---------------
> Alessandro Benedetti
> Search Consultant, R&D Software Engineer, Director
> Sease Ltd. - www.sease.io
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>
Re: spell-check does not return collations when using search query
with filter
Posted by "alessandro.benedetti" <a....@sease.io>.
But you used :
"spellcheck.q": "tag:polt",
Instead of :
"spellcheck.q": "polt",
Regards
-----
---------------
Alessandro Benedetti
Search Consultant, R&D Software Engineer, Director
Sease Ltd. - www.sease.io
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Re: spell-check does not return collations when using search query
with filter
Posted by Arnold Bronley <ar...@gmail.com>.
with spellcheck.q I don't get anything back at all.
{
"responseHeader": {
"status": 0,
"QTime": 10,
"params": {
"spellcheck.collateExtendedResults": "true",
"spellcheck.q": "tag:polt",
"indent": "true",
"spellcheck": "true",
"spellcheck.accuracy": "0.72",
"spellcheck.maxCollations": "3",
"spellcheck.onlyMorePopular": "true",
"spellcheck.count": "7",
"spellcheck.maxCollationTries": "3",
"wt": "json",
"spellcheck.extendedResults": "true",
"spellcheck.collate": "true"
}
},
"response": {
"numFound": 0,
"start": 0,
"docs": [
]
},
"spellcheck": {
"suggestions": [
],
"correctlySpelled": false,
"collations": [
]
}
}
On Mon, Oct 16, 2017 at 5:03 AM, alessandro.benedetti <a....@sease.io>
wrote:
> Interesting, what happens when you pass it as spellcheck.q=polt ?
> What is the behavior you get ?
>
>
>
>
>
> -----
> ---------------
> Alessandro Benedetti
> Search Consultant, R&D Software Engineer, Director
> Sease Ltd. - www.sease.io
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>
Re: spell-check does not return collations when using search query
with filter
Posted by "alessandro.benedetti" <a....@sease.io>.
Interesting, what happens when you pass it as spellcheck.q=polt ?
What is the behavior you get ?
-----
---------------
Alessandro Benedetti
Search Consultant, R&D Software Engineer, Director
Sease Ltd. - www.sease.io
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Re: spell-check does not return collations when using search query
with filter
Posted by Arnold Bronley <ar...@gmail.com>.
Thanks for replying. I tried spellcheck.q=polt and it does not help.
Here is how the query looks like:
http://solr:8983/solr/myapp/select?q=tag:polt&wt=json&indent=true&spellcheck=true&spellcheck.count=7&spellcheck.onlyMorePopular=true&spellcheck.extendedResults=true&spellcheck.collate=true&spellcheck.maxCollations=3&spellcheck.maxCollationTries=3&spellcheck.collateExtendedResults=true
One workaround I found was that if you pass in \ before polt i.e. tag:\polt
then it works as expected and collations object is included in the json
response. I definitely think that this is a bug unless I am missing some
obvious thing here.
On Mon, Oct 9, 2017 at 9:45 AM, alessandro.benedetti <a....@sease.io>
wrote:
> Does spellcheck.q=polt help ?
> How your queries normally look ?
> How would you like the collation to be returned ?
>
>
>
> -----
> ---------------
> Alessandro Benedetti
> Search Consultant, R&D Software Engineer, Director
> Sease Ltd. - www.sease.io
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>
Re: spell-check does not return collations when using search query
with filter
Posted by "alessandro.benedetti" <a....@sease.io>.
Does spellcheck.q=polt help ?
How your queries normally look ?
How would you like the collation to be returned ?
-----
---------------
Alessandro Benedetti
Search Consultant, R&D Software Engineer, Director
Sease Ltd. - www.sease.io
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html