Case insensitive search in Crafer CMS with elasticsearch? - crafter-cms

I wanted to implement auto-completion with type head, following this documentation, I was able to achieve that. But the search was case sensitive.
Following this documentation, it says, to enable case insensitive search I should select Tokenize for indexing option, this way.
I am using crafter CMS 3.1.0 version and I don't use any Tokenize for indexing option;
Note: The version used in documentation is 3.1.9, is this feature not available in 3.1.0?

the feature should work in 3.1.0 too. Keep in mind that after you enable the "Tokenize for indexing" option you will need to reindex all existing content and change your query to use the new field with the _t postfix.

Related

Versioning for Azure Search index definition schemas

I'm updating the index/indexer for a search tool, and apart from just making changes to the definition as I tweak it, I'd like to include versioning metadata in the definition, such that it's picked up by my source control solution.
Does anybody have knowledge of where you can include e.g. version numbers in an index definition? The documentation doesn't suggest that you can have custom json fields within the schema without mucking up the validation.
I've got the same question for indexer definition.
AFAIK, there's no metadata fields that you could define the version number. I recommend you extract the JSON using the REST APIs and version it on source control by yourself.
https://learn.microsoft.com/en-us/rest/api/searchservice/create-indexer
https://learn.microsoft.com/en-us/rest/api/searchservice/create-index

Fuzzy Search in the Search API

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.

How to use lucene query syntax on Orchard CMS

I would like to use the full Lucene query syntax on an Orchard CMS based Website.
Currently, after enabling the indexing and search on Orchard, I can search on the website according to the fields I selected on the Orchard search administration page,
but I cannot perform one search on a particular field only (without changing the behavior on the entire search)
I cannot use fuzzy search...
From the logs, I can see that Orchard take care of that part (providing Lucene a good query syntax), but I would like to do it on my own.
For example, when searching "wel" on the website, Orchard will send to Lucene this query : title:wel* body:wel* (if I have the title and body fields activated on the search).
I did see some blogs that talk about coding some features to customize search, but I would like to be sure I'm not missing something before switching to developer mode :)
There are so many scenarios that can be done with search that there is no way to provide such coverage out of the box, which is why the API is very simple to use if you need custom searching capabilities.
You should copy-paste the controller from the search module and use the Parse() method of the ISearchBuilder with the escape parameter to false. This will parse a pure lucene query. You can also use the WithField("body", "value") to do simpler field search.
I don't believe anyone has released any modules that provide additional search functionality, because if you need it, it is so simple to develop ^_^ So yes, you will have to go dev mode to do custom field search

Adding a LIKE Finder on a Localized column in Liferay Service Builder

I have a column that have been set to Localized="true", is there a way to add a finder that only matches LIKE on specific locale?
Unfortunately, I don't think it would be possible: localized columns are stored as xml strings in db, and I haven't found any example of a search like this in Liferay source. Have you considered using the index? It would be way easier to do a LIKE query for a localized field.
You can use xPath (if you use a db engine that supports it, for example postgresql)

When to use which search technique in Sharepoint development?

When I have to use KeywordSearchQuery, when should I use FullTextSearchQuery and when should I use Query in developing the search part in Visual Studio for a Sharepoint site?
I want to search information from Contact list. If any keyword is put in the search box, I wan related information in our own specified format. Which technique should I use?
I think it depends on the situation. In your case, since you are searching a Contacts list, I would recommend using a regular CAML and SPQuery.
In general:
One list, use a CAML query
Many lists, use search

Resources