No result if search contains dot and wildcard - azure

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.

Related

How do I find mispelled words with sphinx?

Let's say I have the word "catheter". A user tries to search on my web app for that word but spells it "cathiter" or "cattiter" instead. How can I use SphinxQL to match the word from my SQL database based on the incorrectly spelled word? What would my query look like? Do I need to enable something in my index on my conf file? From my understanding, enable_star has been deprecated.
Yes, enable_star=0 has been depreciated, but not sure how that relevant!
Anyway sounds like you want the CALL SUGGEST function
http://sphinxsearch.com/blog/2016/10/03/2-3-2-feature-built-in-suggests/
The defuult settings a good place to start...
CALL QSUGGEST('cathiter','yourindex');
... if you dont min_infix_len defined on index, will need that. Alao dict=keywords - for some reason that requirement not mentioned in blog post.

Solr custom wildcard

I am pretty new to Solr and I am looking for a way to port the search features I have for my web application having a regular database to use Solr indexes. My problem so far is I have to customize the wildcards behaviour: for example, "?" should be "0 or 1 characters" not any character as it is now, "+" should mean any "white-space", "#" should be any digit and so on. Any good pointer?
Thanks!
There is no simple answer that I know of, I am afraid.
For 0 or 1 characters - you can replace the original query with an 'OR' query. Eg. mp? in your db search usecase becomes - 'mp OR mp?' in Solr.
White spaces are tokenized by default in text field. So, you can look at using a white space tokenizer as part of your custom 'text' field. There are several examples. text_ws in the sample schema only does whitespace tokenizing. You'd want to readup on tokenizers.
http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
There is no digit equivalent - you can do term1* OR term2* OR term3* ... etc. You can also use function queries that support numerical functions. http://wiki.apache.org/solr/FunctionQuery
It looks like the best choice in this case is to use regular expressions in the search. More details can be found here: http://1opensourcelover.wordpress.com/2013/09/29/solr-regex-tutorial/
It's not exactly what I was looking for as I will have to build my own solr-query on the back and I have a feeling that regular expressions abuse will create a little bit more overhead on my server. For the test I did it looks pretty fast.
I will leave the question open for a while maybe someone can come up with a better answer.

Marklogic search with ampersand

Suppose I am searching using one of the cts:query API's. I am looking for documents containing the phrase "John and Jane". Some of my documents have "John & Jane"(actually John & Jane) in them. I want them to be returned as well. Also consider reverse situation.
Does Marklogic provide any options to do that?
Queries expressed as cts:query items or XML are easy to rewrite with XQuery typeswitch expressions. The discussion list thread at http://markmail.org/message/6hxmuqnpnfm73j4n has an example of something similar.
Mike gives a good suggestion, but it might be worth to take a step back and look at your problem first. From your comment on Mike's answer I take it that you look for something like thesaurus expansion, but for the 'and' and '&' instead of the other words.
I may be wrong, but to my knowledge MarkLogic doesn't provide features to take care of something like that automatically. Functions like search:search and search:parse are powerfull, but don't go that far. You are up to your own to take a search string like yours, break it into parts manually to wrap it in a cts:query, or use something like search:parse for that, and then pull tricks like that of Mike to walk through your query-tree, and expand any particular search query node you would like to expand in a particular way.
The markmail thread to which Mike points, gives an example of how to walk a query-tree, and manipulate it. A little heavy for this particular case, but there is a thesaurus module that can help in various general cases. The following chapter of the Search Dev Guide explains its features, and ends with a small example of how to apply it:
http://docs.marklogic.com/guide/search-dev/thesaurus#chapter
HTH!
Assume your term to search is "John & Jane"
In order to Search above word ,you can use following line
let $inputSearchDetails ="John & Jane"
let $InputXML := xdmp:unquote($inputSearchDetails, "", ("format-xml", "repair-full"))

Setting a TextFilter's value from a Query String (URL) Filter

I'd like to start off by saying I'm very new to Sharepoint, so I'm sorry if I'm asking something very obvious. I've done quite a bit a googling and can't find an answer to my question. This leads me to believe that maybe I'm asking the wrong question. So, here goes:
We have a Sharepoint webpage that currently contains 3 Web Parts (2 lists and a text filter). The text filter can be used to filter the two lists. I've been asked to provide the following functionality:
A user must be able to open this page from an http link (easy)
The Text-Filter must be automatically filled-in and applied, thus immediately filtering the two lists
This seemed pretty straight-forward to me: Pull a parameter from the page's URL and feed it into the filter.
I found and added a Query String (URL) Filter and I managed to pull the parameter from the URL, but I can't feed it to the existing Filter!
Sure, I can pass the value to the two lists (effectively coding the same filter two different ways) but that seems wrong. So, my question boils down to this:
Is it possible to set a Text Filter's value from a Query String (URL) Filer?
Am I asking the wrong question? Am I looking at this problem in the wrong way? Any help is much appreciated, thanks.
I was asking the wrong question!
It seems you can set a Text Filter's value on page-load through the URL. Here's how:
http://sharepoint-server/site/subsite/project/default.aspx?Text%20Filter%20Name=999
Where Text%20Filter%20Name is the name of your Text Filer (in this case, with spaces in the name), and where 999 is the value you're passing to the filter.

Drupal Views Arguments

I know how to successfully use arguments in drupal's views module, but when it "filters" based on those arguments it uses "=" in the where clause of the SQL statement. However, I would like to use "like" instead of "=" in the where clause of the SQL statement so I can pass in, say the title of a node, as an argument and then show all nodes that CONTAIN the title passed in. I am not interested in grabbing only the nodes where the title is exactly the same as the title passed in. Does anyone know how I can do this? Is this possible?
one possible solution would be to generate the view by code with your required query.
I am looking for the same solution. It looks like you can modify the query using the views_views_pre_execute hook. The link below has a pretty good explanation. Haven't tried it yet but giving it a shot now...
http://drupal.org/node/409808
You could export the view, which outputs the views-generated query as code, then modify the query to suit your needs, and load it programatically (http://www.chilipepperdesign.com/2010/01/15/how-to-programmatically-create-views-in-drupal-6)
In drupal 7 you can use views query alter to generate your custom querys:
Take a look at this example: https://gist.github.com/4001074
I don't think you can do this. See here (https://www.drupal.org/node/1578564):
There are no options for selecting which operator should be used with contextual filters (save the exclude option). All default to is equal to.

Resources