Hi I have implemeted jquery-bootgrid. However, searching is based on case. My requirement is that searching should be done irrespective of case used i.e If am searching for "Australia" and the user types "australia" or "Australia" result should be same.
I looked into the documentation and the search setting only have "dealy" or "charatcers" option. So how should i implement case insensitive search?
The option to switch the behaviour is named caseSensitive and documented under General Settings. I will move this option in the next major release to searchSettings for the sake of consistency.
Example:
$("#grid").bootgrid({
caseSensitive: false
});
Related
How exactly do boost rules work for page items in context to search results? Ideally I would like a rule on a page that is essentially:
Condition: When search term is 'A'
Action: Boost score to 10
The closest thing I have found is this blog post about testing the query parameter via the 'when script returns true' condition but am having no luck in Sitecore 8. Thanks for any ideas.
I am trying to get my head around how fuzzy search works on AWS CloudSearch
I want to find "Star Wars" but in my search, I spell it
ster wers
The logic of my app will add fuzzy but it never returns Star Wars.
I have tried:
ster~1 wers~1
"ster wers"~2
"ster"~1 "wers"~1
What am I missing here?
The reason your query doesn't work is because of how CloudSearch stems. If your field is indexed with the Analysis Scheme set to English, then wars will be stored in its stemmed form as war.
Here's a little demo of how stemming is affecting your query.
Searching with the un-stemmed query ('ster wers'):
Searching with the un-stemmed query requires you to match wers to war, which is off by 2 chars and requires this query: q=ster~1+wers~2.
Searching with the stemmed query ('ster wer'):
Searching with the stemmed version means you're matching wer to war and you're only off by 1 char. Thus ster~1 wer~1 will get the desired result (ie it matches star wars).
How to fix:
The use case you described will work if you configure the Analysis Scheme for the field in question to not use any stemming.
To do this, log into the AWS Web Console and go to Analysis Schemes --> Add Analysis Scheme:
Then go to Indexing Options and configure your field to use your new no-stemming analysis scheme:
Submit your changes and re-index.
That will address your issue but of course you'll lose the benefits of stemming. You can't have your cake and eat it too.
Elasticsearch itself seems to support index-analyzer and query-analyzer,
but haystack's elasticsearch doesn't seem to differentiate them.
Am I Correct?
related question is,
Elasticsearch's DEFAULT_SETTING seems to have 'settings.analysis.anaylyzer' and 'index.analysys.anaylyzer'. (eg. http://www.wellfireinteractive.com/blog/custom-haystack-elasticsearch-backend/ has 'index') What's the difference between them?
With haystack, you want to set the mappings yourself.
I wrote about haystack as well earlier here: Django Haystack Distinct Value for Field
In the settings, you can define analyzers on a per field basis, they can be a default analyzer (which is what haystack defaults to and get's applied at both search and index time) a search time analyzer and a query time analyzer.
It's usually good practice to define both a search time analyzer and index time analyzer, even if they are the exact same.
Using snowball text analyses, you might want to apply this at both search and index time, but something like an autocomplete feature, you might not want that (which is what haystack does). You want the index analyzer to store (edge)ngrams and usually you want to apply a stricter search time analysis, like keyword.
You almost never want to let haystack define the mapping.
As for the second part, see here: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html
Mid way down it says:
"Note you do not have to explicitly specify index section inside
settings section."
I just tried this myself as well, because I had never tested it.
I've got a Haystack/xapian search index for django.contrib.auth.models.User. The template is simply
{{object.get_full_name}}
as I intend for a user to type in a name and be able to search for it.
My issue is this: if I search, say, Sri (my full first name) I come up with a result for the user object pertaining to my name. However, if I search Sri Ragh - that is, my full name, and part of my last name, I get no results.
How can I set Haystack up so that I can get the appropriate results for partial queries?
(I essentially want it to search *Sri Ragh*, but I don't know if wildcards would actually do the trick, or how to implement them).
This is my search query:
results = SearchQuerySet().filter(content='Sri Ragh')
I use to have a similar problem, as workaround or maybe a Fix you can change the query lookup
results = SearchQuerySet().filter(content__startswith='Sri Ragh')
The issue is that django-haystack doesn't implement all lingos from search engines. Of course you can do this.
results = SearchQuerySet().raw_search('READ THE SEARCH ENGINE QUERY SYNTAX FOR GET WILDCARD LOOKUPS')
As Django-haystack says, this is not portable.
You can use icontains or startswith.
Be careful with this one, if a query is for example 'r', this will bring you all 'Model' entities that have a 'r' in its content.
Model.objects.filter(content__icontains=query)
Model.objects.filter(content__startswith=query)
Look at the documentation
How can I make my clearquest search query case insensitive?
Here's a write-up that may provide some insight...depending on what database you're using
http://www-01.ibm.com/support/docview.wss?uid=swg21130205