Search for exact term in an Algolia index - search

I want to filter an index by an exact value of an attribute. I wonder what possibilities Algolia offers for that.
Querying an index always results in a search for substrings, that means a search term abc will always match any object which attribute values contain abc. What I want to achieve is a search for abc that finds only abc as a value of an attribute (in this case I have specific attributes to search in).
One possibility I came up with was tagging, which doesn't seem to be the best way to think of.
Edit
I think I could also use facet filters. I thought about the different pros and cons and can't come up with arguments that places either one position above the other.

You're right with your edit that facet filters would be the way to go on this one. You'll get the exact match you're looking for and won't have to create a new attribute of _tags to use the tag filter.

Related

Saved Search criteria/results seem to have a different naming scheme from everything else

I'm trying to find a resource or explanation for how to determine how a field will display in the criteria or results dropdown of a saved search. For instance, in the results I would like to see the PO# field (fieldId:otherrefnum). But when looking through the drop down, I see neither of these as options. This has been a serious source of frustration for me with many other fields, I'd like to find a definitive way to avoid wasting time on this in the future.
Thank you!
There are a number of contributing factors to this.
The field names you see on forms may have been re-labeled by form customizations
Netsuite normalizes transaction searches to which leads to some (IMO) odd column name re-use.
A lot of old fields or fields tied to functionality (e.g. transaction status fields) don't follow the regular pattern of numeric id and text name.
The records browser helps quite a bit. You can search here and see that otherrefnum is named 'PO/Check Number' in the search editor. (An example of field name normalizing referred to above)
If you look at transaction you'll see it is just search filters and columns. If you compare to Sales Order you'll see something perhaps more familiar in terms of fields.
Even armed with the records browser experience is still needed. e.g.
A sales order has an items sublist and one of its fields is itemtype. In order to get that value in a search you need to select Item fields and then choose Type. A Sales Order's items.description column becomes the line level memo field in search results.
Hope this helps

How to do - wildcard search in Data Catalog (Google Cloud Platform)

How to execute a wildcard/RegEx search in Data Catalog (Google Cloud Platform) ?
It would make sense to search metadata across column names and tag attributes (and there values).
The current documentation only lists very strict search behavior
e.g. for tag:data_gov_template.hasPII(=true)
Needed would be a result for "PII" - I don't care about specifying the exact template name etc.
e.g. labels:etl
if I only search for etl there is no result
(metadata/attributes and values is not searchable on a direct way?)
From your use case, I understood that you want to search for a particular metadata attribute, like a Tag field, PII, right?
For tagged assets
If you don't care about the template name. You could use the tag:x search facet.
So if all your templates, data_gov_template, data_curator_template, data_etl_template, all contain the same Tag field name, has_pii, you can search using:
tag:has_pii and this will return all assets with that metadata attribute, no matter what the template name is.
For columns
You can use the column:x search facet to match a substring of the column name in the schema of the data asset. Which does not support nested columns yet.
For labels
You can use the labels:bar search facet for data assets that have a label (with some value) and the label key has bar as a substring.
You are also able to search on their values. So yes, the metadata/attributes and values are searchable.
But it is not a regex kind, it is a substring match when the search facet uses colon :, like labels:bar or an exact match when the search facet uses equals =, like type=table.

azure search exact match

I have a table with a lot of data. One field is a string for example
searchableField
row 1: abcdefgdefg1hijklmnopqrstuvw234234
row 2: abcdefgdefg1hijklmnopqrstuvw2dsfds33
row 3: abcdefgdefg1hijklmnopqrstuvw234234
row 4:
abcdefgdefg1hijklmnopqrstuvwweewere333wr
row 5:
abcdefgdefg2hijklmnopqrstuvw234222aadfff
row 6:
abcdefgdefg1hijklmnopqrstuvwdsfdsf
I only want result row 5 back, but adding search therm defg2 won't work.
In some other cases I want onl y result 1, 2, 3, 4, 6 back. but also searching on defg1 won't work for me.
Something that should work for me is a filter, but unfortunately there are no filters with contains. What can I do as work around?
Please read the How full text search works in Azure Search article. It will help you understand how your documents and query terms are processed and how to customize the behavior of your search index to achieve the results you want.
In your case, you might want to create a custom analyzer that will break up the long terms in your document into smaller ones that are likely to be used as query terms by users of your application.
Alternatively, you can issue a wildcard or a regex query using the Lucene query language to simulate the contains behavior you're looking for. More information here: Azure search, search by partial terms
Below lucene query will help for doing a like or contains search as above question
item : /.* defg2 .*/
you can use search.ismatch or search.ismatchscoring functions
ex:
"filter": "search.in(metadata_library, 'a3e9838f-3fec-49d8-a1ea-46f361238ffd') and search.ismatch('[exe pixel!][test new tags 102][css monitor]', 'metadata_tags','simple','all')",

excel search for multiple items

I am trying to search for multiple items in a cell. If any of the terms I am looking for is present, I want cell D to display "Laptop", otherwise, display "Desktop". I can get the following to work, with just one term to search for:
=IFERROR(IF(SEARCH("blah",A2),"Laptop",""),"Desktop")
But I want to search for the presence of blah, blah2, and blah3. I don't know how to get Excel to search for any of the following terms. (Not all of them mind you, just any of the following.
I did see that there is an or option for the logic.
=OR(first condition, second condition, …, etc.)
I am not sure how to get these two to work together. Any thoughts on how to get them to display "Laptop" if any of the words are present?
This should work:
=IF(SUM(COUNTIF(A2,"*" &{"blah1";"blah2";"blah3"}& "*"))>0,"laptop","desktop")
You could use the combination of OR, IFERROR and SEARCH as you suggest, but I think the simpler construct would be ...
=IF(AND(ISERROR(SEARCH("value1",A2)),ISERROR(SEARCH("value2",A2))),"Desktop","Laptop")

Solr get field where the maximum keyword match was found

I am not sure if this can be done with solr. But this is what I am doing for an online store search functionality. The main search box is a dismax parser for multiple fields :
qf: description^1.0 color^1.0 name^1.0 size^1.0
Equal weight across multiple fields for now. Further I create a facet on some of these fields
ex: color, size. The client has a request that when they search using a particular keyword and it matches any of the faceted fields the filter appear selected in the front end. So if the user searches for 'red' The color facet for red should appear selected.
Since solr is searching across multiple fields I don't think this is possible or is it?
It is not about Solr. First, This requirement is flawed at user experience level. Traditionally facets (also known as guided navigators) are used to filter search results. Just having "red" across multiple fields does not mean all the products appeared are colr "red" .
When you have "red" selected in Co filter you are visually telling user that all products in search results are "red". If that is not the case do not do it.
It that is the case, then ideal situation is, when the user enters "red" , you should first check user input against colr facets (preferably against cacheed list) and then add that color as filter to query as fq=colr:red parameter so that it is "true" filter and is part of your search query. This can be done against all known displayed facets (colr,size etc.) very quickly and activate them automatically if there is a match. Used right, that would actually make a cool feature.

Resources