I have successfully indexed files, and want to be able to search using wildcards. I am currently using the dismaxRequestHandler (QueryType = dismax) for the searches so that I can search all the fields for the query.
A general search like 'computer' returns results but 'com*er' doesn't return any results.
Similary, a search like 'co?mput?r' returns no results.
Could someone please tell me a way to continue using dismax and be able to do wildcard searches in the 'q' field?
Does edismax handler have this? If so, How do I use it. I have Solr 1.4.1.
Please help me out.
Thanks.
Imran.
Grab latest (trunk) build from Hudson. Use <str name="defType">edismax</str> in the RequestHandler to activate edismax.
Related
I use azure search and have some document with a field like this {"Nr": "123.334.93"}.
If i search for querytype=full&search=123.334.93 then it found multiple document and if I search for querytype=full&search="123.334.93" then it found one document. This is as expected.
But if I search for querytype=full&search=123.334.9* I expect multiple document starting with 123.334.9 but none result are given back.
Do I miss somthing?
The same is when I use a regex expression like this querytype=full&search=/123\.334\.9.*/
Your query looks correct to me and should work.
A couple of things you might look into.
1) Sometimes you need to escape the * like this:
querytype=full&search=123.334.9\*
Usually, this is only necessary if you have more search terms after the *.
2) You can also narrow the fields searched down to only the field you need (for better efficiency) like this:
querytype=full&search=Nr:123.334.9\*
Hope this helps.
Based on the Comment from Yahnoosh.
The analyzer of the field was set to "de.microsoft". I change that to "standard.lucene", recreate and fill the index and it works as expected.
It seems that I have to be more carefully to set the analyzer and only use specific ones for fields with language specific content.
Thanks for your help.
I was comparing both ElasticSearch and Apache Solr for a search solution. Data that will go into the system is not moderated and I don't want anyone to search for something and some sexually explicit content to flash on the very top of the search result. But I don't want to remove them for search results either. I want to demote them, so that they come later in the search results. Can I do this in Solr or ElasticSearch ? Some pointers towards how to achieve this will be helpful.
In Solr you can't give "negative boosts" per se but you can boost everything that doesn't have the term. This can be done with the boost query:
...&bq=(*:* -erotic)^999
or in solrconfig.xml:
<str name="bq">(*:* -erotic)^999</str>
Where "erotic" is the term to which you wish to give a "negative boost". To add another term, add another bq=....
The Azure search api offers a fuzzy paramter for suggestions. like this:
https://blssuggestions.search.windows.net/indexes/cities/docs/suggest?api-version=2015-02-28&suggesterName=default&fuzzy=true&search=berlen
Would return "Berlin" as a result of berlen.
I can't find a documentation about this how to activate it in a normal search
setting there fuzzy = true seems to not change anything
https://blssuggestions.search.windows.net/indexes/cities/docs?api-version=2015-02-28&search=berlen&fuzzy=true
[Update]: Please see the other responsed about using querytype=full as this response is no longer correct.
This is correct. Fuzzy search is only available currently in the suggestions api.
You need to call:
https://blssuggestions.search.windows.net/indexes/cities/docs/suggest?api-version=2015-02-28&suggesterName=default&queryType=full&search=berlen~
You were missing querytype=full and the tilde after the character that you want to execute fuzzy searches on.
This is now in the preview version of the api:
https://{yourSite}.search.windows.net/indexes/{yourIndex}/docs?search={fieldToSearch}:{lookupValue}~&queryType=Full&api-version=2015-02-28-preview
Note the ~ and queryType=Full, both of which are required to force fuzzy matching.
Documentation is here:
https://msdn.microsoft.com/library/azure/mt589323.aspx
CAVEAT: The fuzzy search is very fuzzy! i.e. dog will match any 3 letter word with only a single matched letter - dim, now, bag
I am trying to figure out how to tune and tweak but as it is still in preview the documentation is sparse.
UPDATE: I just re-read the documentation and it has since been updated with details of an optional distance parameter. I will investigate.
I'm developing a Lucene search for my Zend 1.12 site. I would like to combine fuzzy search and field boosting. I try syntax like
title:"query"^10~0.8 OR description:"query"~0.8
It seems not to change results. I've also tried to find hints on the Internet, nobody had similar problem. This is query for particular setting and field boosting cannot be set in advance.
The question is: does Lucene support such a combination of modifiers? Is this syntax correct?
In our compass mapping, we're boosting "better" documents to push them up in the list of search results. Something like this:
<boost name="boostFactor" default="1.0"/>
<property name="name"><meta-data>name</meta-data></property>
While this works fine for fulltext search, it does not when doing a field search, e.g. the boost is ignored when searching something like
name:Peter
Is there any way to enable boosting for field searches?
Thanks for your help and sorry if this is a dumb question - I am new to Lucene/Compass.
Best regards,
Peter
I am sorry, please ignore this question. The reason was completely different, the search result got blurred by a bad query :(