Neil
Neil

Reputation: 1

Why dismax q.alt doesn't return any result

I'm new to solr. After following the tutorial exercise 1(https://solr.apache.org/guide/8_9/solr-tutorial.html), I'm able to do some solr query on my loacl machine.

If I want to get result without condition, I will do the query like

http://127.0.0.1:8983/solr/#/techproducts/query?q=*:*&q.op=OR

This works pretty fine.

But when I switch to "dismax" and try to have similar result, I do need to use "q.alt". The query is like

http://127.0.0.1:8983/solr/#/techproducts/query?q.op=OR&defType=dismax&q.alt=*:*

However, this query resulted in no result, which is pretty weird. Even thought I specified the row, it still won't work.

http://127.0.0.1:8983/solr/#/techproducts/query?q.op=OR&defType=dismax&q.alt=*:*&row=0

Does anyone face the same problem before?

Upvotes: 0

Views: 115

Answers (1)

MatsLindh
MatsLindh

Reputation: 52822

These parameters are not meant to be used with the user interface URLs; they're for sending directly to Solr. The user interface is a Javascript interface that talks to the Solr API behind the scenes. You can see that your urls have a local anchor in them (#), and this is just references that the javascript based user interface uses to load the correct page.

The rows parameter is also named rows, not row - and when used with 0, no documents will be returned (in the example it's given as an example for using facets with complete counts - you have to ask for facets for that to make sense).

The actual URL to query Solr for matching documents would be:

http://127.0.0.1:8983/solr/techproducts/select?defType=edismax&q.alt=*:*

This URL is shown in the user interface over the query results when using the query page.

There is also usually no reason to use dismax and not edismax these days, as edismax does everything that the old dismax handler did and with more functionality.

Upvotes: 0

Related Questions