No body answer this question
So I ask it again
Given solr has these documents:
'Danniel Wellington'
'George Wellington'
'Wellington'
when I search for : "Danniel Wellington"
I want to get the result as below:
'Danniel Wellington'
'Wellington'
Which means we want to get subset of specified string
Is there any existing analyzer which can achieve the above
Thanks a lot in advance
Related
I have indexed few documents and now while trying to query a string from solr admin console, I am able to retrieve score value for each result retrieved by selecting field as score. But I would need to check the doc score, termfreq and other parameters considered for calculating this score which can help me to debug and understand. Can anyone help me with the possible ways? Are there any certain keywords or fields or query parameters to be specified while querying from solr admin console? Solr Version that I am using is 7.6.0.
Add debug=all (the new version of debugQuery=true) to your query string. It'll include a detailed explanation of how each part of your query contributes to the score.
My question is I found when I use wildcard in solr query, it will be very slow. So I don't want to use the wildcard(*) query, for example, I want to search the mail address (gosling.abc#gmail.com), if I input 'abc' keywords, my q parameter maybe like q:abc
How should I do with this condition?
I am newbie in solr, can anyone help me?
(Currently, I have 10,937,547 document in my solr cloud. My solr version is 4.1)
I have a field with value of "holmes#sible.com"
I want get back this field If I search for "sible".
I use ngrams filter, which would help only if the string was "sible#holmes.com"
Which filters/tokenizers should I use for such a thing (pretty much the LIKE in sql).
EdgeNGramFilterFactory would help only if the string was "sible#holmes.com" but NGramFilterFactory will get what you want with "holmes#sible.com" too.
I had indexed data into Solr and add data into "name","features" field.
So, when I get data using java code I use "getFieldValue("name")" it returns the name into java variable.
When I use java code to get "name" values, I got null values.
When I look into Solr Admin Page: I had seen
"Features" field in Solr has properties "Indexed, Tokenized, Stored, Multivalued".
How can I get the values of Features into variables and print that.
Kindly ask me to further clarify my question.
My best guess is that getFieldValue() returns a Collection for multi-valued fields but you are expecting a String.
It may help if you can post the full code snippet you are using.
Solr newbie here.
I have created a Solr index and write a whole bunch of docs into it. I can see
from the Solr admin page that the docs exist and the schema is fine as well.
But when I perform a search using a test keyword I do not get any results back.
On entering * : *
into the query (in Solr admin page) I get all the results.
However, when I enter any other query (e.g. a term or phrase) I get no results.
I have verified that the field being queried is Indexed and contains the values I am searching for.
So I am confused what I am doing wrong.
Probably you don't have a <defaultSearchField> correctly set up. See this question.
Another possibility: your field is of type string instead of text. String fields, in contrast to text fields, are not analyzed, but stored and indexed verbatim.
I had the same issue with a new setup of Solr 8. The accepted answer is not valid anymore, because the <defaultSearchField> configuration will be deprecated.
As I found no answer to why Solr does not return results from any fields despite being indexed, I consulted the query documentation. What I found is the DisMax query parser:
The DisMax query parser is designed to process simple phrases (without complex syntax) entered by users and to search for individual terms across several fields using different weighting (boosts) based on the significance of each field. Additional options enable users to influence the score based on rules specific to each use case (independent of user input).
In contrast, the default Lucene parser only speaks about searching one field. So I gave DisMax a try and it worked very well!
Query example:
http://localhost:8983/solr/techproducts/select?defType=dismax&q=video
You can also specify which fields to search exactly to prevent unwanted side effects. Multiple fields are separated by spaces which translate to + in URLs:
http://localhost:8983/solr/techproducts/select?defType=dismax&q=video&qf=features+text
Last but not least, give the fields a weight:
http://localhost:8983/solr/techproducts/select?defType=dismax&q=video&qf=features^20.0+text^0.3
If you are using pysolr like I do, you can add those parameters to your search request like this:
results = solr.search('search term', **{
'defType': 'dismax',
'qf': 'features text'
})
In my case the problem was the format of the query. It seems that my setup, by default, was looking and an exact match to the entire value of the field. So, in order to get results if I was searching for the sit I had to query *sit*, i.e. use wildcards to get the expected result.
With solr 4, I had to solve this as per Mauricio's answer by defining type="text_en" to the field.
With solr 6, use text_general.