does anybody know if there is a possibility to search for '-' using FTSearch?
Set col = db.ftsearch({ [services] = "-"}, 0)
dat requests does not work and instead says:
Notes error: Full text error; see log for more information (
[services] = "-")
Short answer is no.
The full text search treats most symbol characters as a white space. The exception is if the search term itself is wrapped in quotes.
The FT search engine also uses 3-gram for searching. This means that less then 3 characters will not return the results you expect. White spaces would be treated in that search, but only in the context of the found text.
For example: "ce " would find "space " but not "space." or "space" or "spaced".
If you are looking for the field that only contains "-", then a better solution is to create a view with a column containing that field value, and/or filter by that field being that value.
Looks like you are trying to do a full text search in a view? You probably would get better response time and less server impact to use #Formula language if you are working with a view.
I try to keep away on doing full text searches on the entire database. You can use a search on a view collection for faster results. There is no restriction on how many views you can have in a db. There is a cost for everything though. There are so many little tricks that can be used to get better results. Please give us more details on what you are trying to do.
Related
I currently use Typesense to search in an HTML database. When I search for a term, I would like to retrieve N characters before and N characters after the term found in search.
For example, I search for "query" and this is the sentence that matches:
Let's repeat the query we made earlier with a group_by parameter
I would like to easy retrieve a fixed number of letters (or words) before and after the term to show it in a presumably small area where the search results is retrieved, without breaking any words.
For this particular example, I would be showing:
..repeat the query we made earlier..
Is there a feature like this in Typesense?
I have checked Typesense's documents, without any luck.
The feature you're referring to is called snippets/highlights and it's enabled by default. You can control how many words are returned on either side of the matched text using the highlight_affix_num_tokens search parameter, documented under the table here: https://typesense.org/docs/0.23.1/api/search.html#results-parameters
highlight_affix_num_tokens
The number of tokens that should surround the highlighted text on each side. This controls the length of the snippet.
I created an ArangoSearch view over a collection and am using the SEARCH keyword with wildcards w/ LIKE to search a field with spaces, similarly to how MySQL would. The problem I am running in to is, I keep getting an empty set even though records with the Star Wars title definitely exist.
Note, searching for '%star%' works and returns results... as soon as I add a space and search for '%star wars%' the query returns empty set.
This is the query
FOR d IN imdb_norm
SEARCH ANALYZER(d.name LIKE "%Star Wars%", "text_en")
RETURN d.name
This is the structure, running arango version 3.7.2
The thing is since you're using text_en, it breaks up strings into individual words Since all spaces are considered as break characters, there is not a single term (a word stored in aragnosearch index) containing a whitespace.
If you don't need tokenization, please can consider indexing a word as it is (i.e. without case conversion, accent removal, etc) using identity analyzer, or check out norm analyzer instead.
https://www.arangodb.com/docs/stable/arangosearch-analyzers.html#analyzer-types
I have a fairly simple index where all 10 or so fields are searchable strings and my searchMode is "all".
For sake of simplicity let's say I issue the following search:
-(x|y|z)
And I get all documents that do not have x, y or z in them.
Let's say I issue the following search:
(i+j)
And I get all docs that contain the terms i and j.
And lets say there is a decent overlap between the docs that are returned by the two searches.
I would have thought that in "all" searchMode if I issue the following:
(i+j) -(x|y|z)
I would receive the subset of i and j that do not contain x, y or z. In other words the results of the combined query would not contain any entries from the results of the individual query -(x|y|z).
But that's not the case.
Either I am misunderstanding the functionality or I am receiving wrong results.
Can someone help explain this to me?
Thanks
Azure Search should give consistent answers for this, if not let us know.
In this case it was an issue with escaping "+" in URLs (see comments). Search text in the URL query string needs to be escaped (e.g. + should show up as %2B, but it's best to use a library function to escape all the input search text instead of special-casing any particular character; there's functions for this in most environments and they know which characters need escaping).
I am using a view control in an XPage, and have incorporated a search with much struggling.
I also have a dropdown to select a category, to be used as an additional filter with the search.
My query is now:
sessionScope.searchTerm AND Field Category=" + sessionScope.categoryname + "
Everything finally works except that the category filter is finding non-exact matches, for example "Management" finds the documents in the categories "Management" but also in "Facilities Management". This is not acceptable.
I tried setting searchExactMatch=true in the View properties, but this gives a stack trace, and in the log is the error: "GTR search error: Case sensitive parameter error.: Query is not understandable"
So I guess this parameter is for exact case matches instead of exact search term matches as is implied. Not what it says in the help, but OK I roll with the punches as usual.
If I use the "Filter by category name" the category filter works great with no search term, and the search seems to work OK except that the categoryFilter setting is now ignored.
This seems to be the common behavior, that these settings all work fine in isolation but never in combination. This is what I found for view keys as well.
I am now out of ideas, can anyone offer assistance?
This is a bit hackery solution but You could have additional computed field categorySearch with additional content delimiters, for example You could add additional % characters: %Completed% and then Your search query would look like this:
sessionScope.searchTerm AND Field categorySearch=%" + sessionScope.categoryname + "%
I hate myself for proposing this kind of solution but if this work then maybe I will be forgiven.
You have to search according to this article: http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Searching_for_Documents#Full-text+Search
In your case do the following for the Category part:
"[Category] = \"" + sessionScope.categoryname + "\""
I am indexing the title field for few products in Solr.
But when I am searching, I am not getting those titles in response.
For eg. I am storing following as title : Baboons Typing Tshirt
But when I am searching following I am not getting any result !!!
1)title:Baboons
2)title:(Baboons Typing Tshirt)
3)title:(Baboons*)
On the otherhand, if I am searching like this, I am getting lot of results
1)title:(Tshirt)
I have indexed many titles containing word Tshirt but I want to search a specific title which is failing..!!
I dont know whether Solr is ignoring first words, or it is doing something random.
My Question is basically: If I have a search title with lots of words, I will like to match it with the title which contains maximum common terms.
How to do it?
Thanks
Solr works like that by itself. You don't have to change anything.
You have to be careful how you set up your fields in schema.xml, i.e. how analysis is done.
You can use Solr's admin > Analysis interface to see how exactly your title field (when indexing) and query (when searching) is processed (tokenized, transformed).
Remember, match, in order to occur, requires identical word (case and everything) on both sides (index & query).
To open your index and see how Solr has actually indexed your data, use Luke.