Solrnet - Boost query with function - solr

I am trying to query sol using solrnet.
I am looking to boost the query by a record's property.
My query then looks like this:
/select?fl=QualityScore,score&q={!boost+b=sum(1,log(sum(1,QualityScore)))+v=$qq}&qq="qome query"
Is there a way to do this using SolrNet?
PS - I already looked at SolrNet queries with boost functions and I dont see the same result when I use 'bf'.

Mauricio's pointer is what helped me in this case.
Local Params

Related

How to add conditionals or filters to a solr terms query for autosuggest

I've implemented a solr terms query for an auto suggest component.
This is how a regular query looks like:
https://myserver.com/solr/mydata/terms?omitHeader=true&wt=json&json.nl=flat&terms=true&terms.regex=.%2my search term%2A&terms.limit=20&terms.fl=location&terms.fl=price&terms.fl=state&terms.fl=city&terms.fl=country&terms.fl=id&terms.regex.flag=case_insensitive
Now my client would like to filter the results based on different criteria like location=XXX or product-price > xxx. So far I cant find a way to achieve it.
Any suggestion?
Thanks

solr: Using MLT with edismax, is there a way to fetch interesting terms then pass then to edismax regular query?

Wanted to enrich morelikethis generated interestingTerms query adding some custom field:value^boost to it.
My current solution is:
- run a mlt query seeting interestingTerms=details
- building a query from interesting terms (term^score term2^score2...)
- append edismax main query with interesting terms query.
Is there a better solution (maybe even in a single query call?)
EDIT: I also need to use bf (boosting functions)
The /tvrh handler (the termVector query) does that
You can find my implementation in this Clojure Solr wrapper named Corona.
In https://github.com/Stylitics/corona/blob/master/src/corona/query.clj#L187
look at query-term-vectors and at query-mlt-tv-edismax which uses it.
Another possibility would be to use the {!mlt ...} query parser. Docs can be found here https://lucene.apache.org/solr/guide/7_7/other-parsers.html#more-like-this-query-parser

How to get a Query object from solr query string

There are solr query strings available from the log ,and the intent is to analyze the query to find out number fqs ,terms etc. Is there any api/parser available in solr/lucene to parse the entire query string and get the terms used ,filters used ,languages used ,fields used etc. Looked at QueryParser provided by lucene ,but it doesn't seem to help.
Example simple query string:
q=*:*&facet.field=Language&facet=true&f.Language.facet.limit=101&rows=0&sort=score desc,DefaultRelevance desc&fl=xxNonexx&bmf=50&wt=xml
You can use the SolrRequestParsers.parseQueryString() method to convert the string into Solr Params. Here's a link to documentation for it.
Below is an example.
String queryString = "q=*:*&facet.field=Language&facet=true&f.Language.facet.limit=101&rows=0&sort=score desc,DefaultRelevance desc&fl=xxNonexx&bmf=50&wt=xml";
MultiMapSolrParams solrParams = SolrRequestParsers.parseQueryString(String);
The code resides in the solr-core library, so you may need to add it.
I think you're not really looking for a parser but for a way to debug your query. Fortunately Solr has a debug parameter that you can use for such purpose as explained here. For instance you can add to your query:
q=*:*&facet.field=Language&facet=true&f.Language.facet.limit=101&rows=0&sort=score desc,DefaultRelevance desc&fl=xxNonexx&bmf=50&debug=true&wt=xml

SOLR AND clause in q object

I need to query SOLR index using a WHERE clause -
When I try with AND clause its not working
NOT WORKING
category:2 AND -document_type:category
WORKING
category:2 -document_type:category
Which is the correct syntax?
You could try to pass -(document_type:category) as a filter query (fq=-(document_type:category)). Should work that way and is also faster because of optimized caches on filter queries.
Also tested your specific case, but it also works for me in a regular query.

Field grouping in SolrNet?

I am trying to make a query in solr.net that generates a solr query with a filter query with more than one term in it e.g.: fq=Size:(4 large)
However, when I pass ?f_Size=(4 large) in the query string to the SolrNet sample app (found here: http://code.google.com/p/solrnet/downloads/list), no results are found.
Looking at the logs, I can see that the filter query generated is fq=Size:"\(4+large\)" so it makes sense that no results are found.
Is there a way in SolrNet to generate a filter query with more than one term?
Where the filter queries are built, try replacing Query.Field(...).Is(...) with Query.Simple(...) (you have to build the query yourself). See the wiki for reference.

Resources