Get all documents matching a query in vespa - vespa

I have total 1600 documents in vespa but using query I am only able to get 400 documents as there is limit of 400 in vespa. How can I get all documents using query in vespa or is there any other way to to do this. Here is the query I am using:
https://localhost:8080/search/?yql=select * from sources * where default contains "7eNMedftCqkKoaw" limit 400;
Please help!!

So, by default the maximum number of hits you can get for a query is 400 as you have noticed. You can change this by adding a query profile (https://docs.vespa.ai/documentation/reference/search-api-reference.html#queryProfile) with the setting "maxHits" to whatever you like.
See https://docs.vespa.ai/documentation/query-profiles.html for information on how to add query profiles.

Related

Solr: How to resort top documents from query?

I am running Solr 4.10.3 and trying to resort top 10 documents come from Solr. How can i do that? I am thinking of sub-query but don't know how to do that, needed help.
Example:
Suppose on query of "car" Solr return 250 documents on the basis of high score of relevancy. Now from 250 documents take top 10 documents and resort them on the basis of custom field.
i can't do that:
select?q=car&sort=score desc, pr desc
Because it will do sorting on entire 250 documents. So is there any solution?
I think you mean query reranking ? This is what is used when you want to:
use a first, more lightweight query to get a result based on the score
get a fair top x number of matches, like 2000 for example
use a heavier query to resort only those again, to get the final score
That is what you need to use if you want to do it in two steps, like you state. Now, I am not sure you need to use query reranking for your use case, maybe just boosting by that field, or sorting on a function should be enough for you.

limit total number of results in solr

I want to limit the total numbers of results in a solr response.
Lets say I have 200 records in response.I am using pagination start=0,rows=10.
I want to limit it 100.So even though if we try start=100 and row=110.it should not gives us any response.
Is there any way I can fix the total results?
Any Inputs?
Thanks.
You can use pagination with SolrQuery with solr . you can use query.setStart(100) , query.setRows(110) to limit no of rows to be returned by query .
in your case this function can be used as query.setStart(100) i.e start of your result , and query.setRows(110) will be end of your result ..
this will return document starting from 100 to 110 in response

Find total number of terms indexed in a particular document solr

I have read extensively about solr and it gives me the ability to find termfreq i.e. the number of times the required text is available in the document. But I need to know the total number of terms that have been indexed in a particular document. The query I am trying is
/solr/live/select?qt=albumsearch&q=pak%20pak&fl=%2Cscore&wt=json&indent=true&defType=edismax&q.alt=as&qf=a%5E10+l%5E10&bf=12234&boost=termfreq(song,.)
Any help will be appreciated.
You can use either the Luke Request Handler with a docId parameter, or use the Stats Component with a query / fq that results the document you're interested in.

SOLR - Limiting Search Results

Is there a way to restrict the number of search results returned from SOLR. I am working for a client who would like to restrict the search results to 100 (based on search score) . I can use rows but that would only restrict the results per page and not the total results. The problem with that is If the sort function of SOLR is used, it would sort all the results and the product which has 105th rank based on score might come on top because of the low price. I want the sort to happen only on the top 100 results. Is there a way to do that ?
Thanks for your help!
Supreet
You can use the Sort By Function.
You will have to query the normal way with rows=100 and also add the &sort=<query>.
I could not try it as I do not have a Solr instance right now. Please let me know if ti works or not.

Solr search query facet is returning only 100 results

I am calling solr search hosted on a different machine with a query. When I wrote a query, it returns numFound=2405 matching docs. we have more than 10000 doc indexed. But the facet results that is being returned has only 100 count of ids that i am fetching as a facet fields.
My solr query is here (split for readability):
localhost:8983/solr/select/?
q="C"
&start=0&rows=10
&facet=on
&facet.field=currentEmployer
&facet.field=state
&facet.field=industry
&facet.field=education_university
&facet.field=workHistory_employer
&facet.field=id
&facet.mincount=1
why is this so? Please help me where i am doing wrong?
Default value for facet.limit is 100
Add this request parameter to vary the number of facets returned.
A negative value means unlimited.

Resources