Is there a way to add 'fl' parameter to a Solr query to return all attributes without "_" symbols? - solr

I want to retrieve all attributes in a query from Apache Solr(9.0.0) which does not have any underscores. what should the fl parameter be to achieve this?

Related

Is there a way to exclude fields in Solr?

What is the fl parameter I have to use to get all fields in a document except for "field1" in Solr?
Right now is not possible to define, in the fl parameter, the fields to exclude from the results. You have to define all the fields you want and not put field1 in the list. Another possibility is using the regex syntax, as you can see from the official documentation: https://solr.apache.org/guide/solr/latest/query-guide/common-query-parameters.html#fl-field-list-parameter
A different solution can be to not store the field in Solr, this possibility clearly depends on your field usage.

Solr/Lucene contextual SynonymFilter

I created a version of the SynonymFilterFactory to load the Synonym configuration file from the DB, refreshing every X seconds because of the customer requirements.
Now I need something similar, I need to use different synonyms for different value of a parameter in the query, I will use the fq parameter to do this because every user only search on documents that will match a categorization term on a field.
So I need to create the SynonymFilter, with different configuration based on the fq parameter, e.g.: if fq=A I use a set o synonyms, if B another SET.
How can I read the fq parameter in the create method of a FilterFactory? Where can I search for this query parameter?
I'll be satisfied also to catch the request original get values in the filter factory

How to remove/exclude a doc based on unqiue id from the solr result

I am using solr4.10 , i have few document ids that must not be displayed from any search query.Could some provide inputs as how this could be achieved.
Try this:
/select?q=*:*&fq=tag_id:367 AND id:[* TO *] -id:(306670 302209)
Add you document ids inside -id:(X, Y, Z) to exclude them.
You can find the answer here.
if you know the ids you can add them in the filter query.
fq : This parameter can be used to specify a query that can be used to restrict the super set of documents that can be returned

Solr; read specific data

Is there anyway to read specific data in solr? For example; using nutch I crawled http://www.amazon.com/Jessica-Simpson-Womens-Asymmetrical-X-Small/dp/B018MRT16Q/ref=lp_13906149011_1_3?m=ATVPDKIKX0DER&s=apparel&ie=UTF8&qid=1455828781&sr=1-3&nodeID=13906149011;
then with solr I want it to search through and just display the price of the jacket.
Yes. If you only want to search and return a particluar field, you can explicitly search on that field using <fieldname>:<query> and to only return some particular fields use the fl parameter fl=Price.
So your solr query should be something like this:
http://localhost:8983/solr/collection1/select?q=Price:500&fl=Price
Additionally if you want to search over and return multiple fields, use the qf parameter along with the edismax parser like this:
http://localhost:8983/solr/collection1/select?q=500&fl=Price,Name&defType=edismax&qf=Price,Name

How does Solr process the query string when using edismax qf parameter and specify field in query

All:
[UPDATE]
After reading the debug explain, it seems that the qf will expand only
the keywords without specifying field.
===================================================================
When I learn to use edismax query parser, it said the qf paramter is:
Query Fields: specifies the fields in the index on which to perform
the query. If absent, defaults to df.
And its purpose is to generate all fields' combination with the query terms.
However, if we already specify the field in query( q prameter), I wonder what happen when I specify another different fields in qf?
For example:
q=title:epic
defType=edismax
qf=content
Could anyone give some explanation how SOLR interpret this query?
Thanks
When you specify qf it means you want solr to search for whatever is in the "q" field in these "qf" fields. So, your first and third line contradict each other:
q=title:epic
defType=edismax
qf=content
If you want to search for any document where the content field contains anything matching your search terms, but these search terms as tokens in "q" separated by +OR+.
like this...
q=I+OR+like+OR+books+ORand+OR+games
defType=edismax
qf=content
When q=title:epic. It means you has settled the query field to title, so the qf parameter could not be set as "content", in this case, you have no query result for sure. You leave the qf parameter empty or set it as "title"

Resources