SeaseLtd/solr-quantities-detection-qparsers

Prerequisits for running quantities detection

Closed this issue · 4 comments

I tried to get it running, using the test solr index ans test unit description.
But it did not work as described in the wiki (examples).

So:
how has the URL to be formated?

Some examples, which did not work as expected:
http://127.0.0.1:8983/solr/test/try?q=beer%2025cl&debug=true&echoParams=all
http://127.0.0.1:8983/solr/test/try?q={!qty%20v=%27name:beer%2025cl%27}&debug=true&echoParams=all
http://127.0.0.1:8983/solr/test/select?debugQuery=on&q={!qty%20q=%27pils%2033cl%27}&rows=100
...

Hi @ChristophKohler sorry for such delay in response, could you please expand a bit your context?
I don't see anything wrong in your queries, at least at first sight, so probably that has something to do with your data or configuration.

I would be great if you paste some info about:

  • the configuration (schema, solrconfig), including the units.json
  • the data you're indexing
  • what you expect to see ("did not work" doesn't help me so much :) )

Hi, here are the requested Information:

For the Index, I use your test configuration:
https://github.com/SeaseLtd/solr-quantities-detection-qparsers/tree/master/src/test/resources/solr.home/test

  • schema.xml
  • solrconfig.xml
  • units.json

With one change to solrconfig.xml - the path of the libs points to a different folder

  • original-solr-quantities-detection-qparsers-1.0.jar
  • solr-quantities-detection-qparsers-1.0.jar

I Indexed your Data:
https://github.com/SeaseLtd/solr-quantities-detection-qparsers/blob/master/src/test/resources/docs.xml

For query http://127.0.0.1:8983/solr/test/try?q=IMPERIAL%2065cl&debug=true&echoParams=all I get 4 Results

{
"responseHeader":{
"status":0,
"QTime":3,
"params":{
"q":"IMPERIAL 65cl",
"defaultBoost":"{!bfqty v=$q}",
"defType":"qty",
"df":"name",
"debug":"true",
"echoParams":"all",
"bq":"{!bqty v=$q}"}},
"response":{"numFound":4,"start":0,"docs":[
{
"id":"12",
"country":"Norway",
"capacity":25.0},
{
"id":"18",
"country":"USA",
"capacity":65.0},
{
"id":"19",
"country":"USA",
"capacity":65.0},
{
"id":"32",
"country":"USA",
"capacity":35.5}]
},
"debug":{
"rawquerystring":"IMPERIAL 65cl",
"querystring":"IMPERIAL 65cl",
"parsedquery":"+(DisjunctionMaxQuery((name:imperial)) DisjunctionMaxQuery((name:65cl))) MatchAllDocsQuery(:)",
"parsedquery_toString":"+((name:imperial) (name:65cl)) :",
"explain":{
...
"QParser":"ExtendedDismaxQParser",
"altquerystring":null,
"boost_queries":["{!bqty v=$q}"],
"parsed_boost_queries":["MatchAllDocsQuery(:)"],

I expected in accordance with (https://github.com/SeaseLtd/solr-quantities-detection-qparsers/wiki/Examples):
something like
"parsedquery_toString":"+((name:imperial)"
"parsed_boost_queries":["capacity:25"],

I've reproduced the issue, it is related to an error during the configuration file parsing.
I'll merge the fix asap

Thanks @ChristophKohler

Hi @ChristophKohler, the issue has been fixed: at the end it was just a matter of configuration file (units.json), please use this last version.
You will find the last commit also some other minor changes: they're not so relevant so you can skip then (I fixed the jar lib path, and declared as "stored" the product name).

Thanks again and sorry for such delay in response
Andrea