KQL Search with CollapseSpecification not working - sharepoint-online

I use KQL Search with CollapseSpecification to search within document libraries on several tenants without any problems, but on one tenant this does not work.
I have revised the search patterns and re-indexed the entire site collection but it is not working.
Is there any functionality/configuration I need to enable to make CollapseSpecification work in KQL Search?
I tried the following query with REST Api:
https://{mySharePointSite}/_api/search/query?querytext='test'&selectproperties='RefinableDecimal01'&collapsespecification='RefinableDecimal01'
with or without CollapseSpecification I get 3 results, all items have RefinableDecimal01=34 so the expected result should be 1
The same behaviour occurs with the CSOM code below:
KeywordQuery keywordQuery = new KeywordQuery(context);
keywordQuery.QueryText = "test"
keywordQuery.CollapseSpecification = "RefinableDecimal01";
keywordQuery.SelectProperties.Add("RefinableDecimal01");
Can you help me.
THX

Related

Azure Search Autocomplete API not working for Fuzzy search

I have configured azure autocomplete API with all parameters. It gives results for normal keywords but when I tried with misspell keyword then it doesn't provide me expected results. Also, I have added UseFuzzyMatching=true while configuration.
eg. machine -> gives the expected results. If we try with magine then it provides 0 results from autocomplete API.
Please let me know if I'm missing any configurations to make Fuzzy workable.
I have data in my index that contains product description and comment fields 'Boormachine' or 'machine', also it provide me result in search API for this.
I have configured suggester while creation of index with the following source fields:
Comment, CommentSmall, Description,
ItemBrandDescription, Itemcode,
ItemGroupDescription,ItemSupplierCode,
SupplierCode
We have configured autocomplete API with this:
as I need to find for keyword suggestions not in group and brand name so excluded these two fields from search fields in configuration.
We can see fuzzy related configuration in autocomplete with UseFuzzyMatching flag. Please let me know if I am missing some configuration to work fuzzy in azure search autocomplete API.
For References click this Link
The behavior Azure Search is providing is correct.
Magine is a different term than machine, and probably it does not exist in your index, this is why you're getting 0 results. To enable Fuzzy Search you actually need to append the ~ symbol to the term, so your search will look like:
"search=magine~"
https://learn.microsoft.com/en-us/azure/search/query-lucene-syntax#bkmk_fuzzy

How get List of items from Netsuite using java api

How I can get Item list from NetSuite using suite talk java API. I am
able to get single item using internal Id but I need to get All list of items or by pagination (batch). Please advise how can I do this?
Code for get one inventory item:
RecordRef recordRefs=new RecordRef();
recordRefs.setType(RecordType.inventoryItem);
recordRefs.setInternalId("6")
ReadResponseList responseList = client.callGetRecords(recordRefs);
Use a search. You'll probably want an advanced search, since you're retrieving so many results. Here's a great example of an advanced search with pagination: https://stackoverflow.com/a/47538464/10393810
(Note that you will be using an ItemSearchAdvanced, not TransactionSearchAdvanced as in the example)

SharePoint online Search returning multiple site collection results

Hi ,
I want to restrict search of Sharepoint results to just one site collection.
For this i created a new result source and tried the following queries
{?{searchTerms} SPSiteURL={SiteCollection.URL}}
{?{searchTerms} -contentClass:STS_Site Path={SiteCollection.URL}*}
Tried the Path in text string too but doesn't work .
In fact if i use Path it doesn't bring any results back.
I understand it doesn't need full crawl . is this correct ? where am i going wrong
Please try the below query to get search results ,Related to what we are typing on searchbox.
path:URL {SearchBoxQuery}*
OR
SPSiteURL:URL {SearchBoxQuery}*
Eg:
path:https://test.com/sites/test {SearchBoxQuery}*
SPSiteURL:https://test.com/sites/test {SearchBoxQuery}*
If you need to filter by a particular text.
path:URL welcome*
OR
SPSiteURL:URL test*
Eg:
path:https://test.com/sites/test welcome*
SPSiteURL:https://test.com/sites/test test*
For multiple site collections
path:https://test.com/sites/test1 OR path:https://test.com/sites/test2 {SearchBoxQuery}*
OR
path:https://test.com/sites/test1 OR path:https://test.com/sites/test2 welcome*

How to query for isinactive item using Netsuite REST API

I have what must be a simple question, but I've scoured the documentation and web and can't seem to find an answer.
Is there a way to query on isinactive when querying for items via the Netsuite API?
In my RESTlet when I try to specify "isinactive" with new nlobjSearchColumn() I get an error saying "undefined".
When I add a filter via new nlobjSearchFilter('isinactive', null, 'is', 0) it doesn't give me an error, it simply ignores the condition.
All I really want to accomplish is to query for active records only along with all of my other search criteria.

What is the internal id(name/number) for a saved search record type?

I created a savedSearch for a savedSearch itself via UI with an internal id customsearch_savedsearch.
When I'm loading the search using a suiteScript. It shows me an Unexpected error has occured.
var search = nlapiLoadSearch(null, 'customsearch_savedsearch');
The above statement works fine for all other record-types, But fails for a savedSearch record type.
What could be the internal id for the savedSearch record type?
You cannot use null for the first parameter. When loading or creating a search, you must specify the record type for the search as well. Whatever record type customsearch_savedsearch searches for, that's what you would pass in as the first parameter.
So for instance if your saved search is a Customer search, then you would load it by:
var search = nlapiLoadSearch('customer', 'customsearch_savedsearch');
Try
var search = nlapiSearchRecord(null, 'customsearch_savedsearch');
Documentation:
nlapiSearchRecord(type, id, filters, columns)
Performs a search using a set of criteria (your search filters) and columns (the results). Alternatively, you can use this API to execute an existing saved search. Results are limited to 1000 rows. Also note that in search/lookup operations, long text fields are truncated at 4,000 characters. Usage metering allowed for nlapiSearchRecord is 10 units.
This API is supported in client, user event, scheduled, portlet, and Suitelet scripts.
If `
var search = nlapiSearchRecord(null, 'customsearch_savedsearch');
does not work`use
var search = nlapiSearchRecord('', 'customsearch_savedsearch');
Everything looks correct in your statement. I think the problem is that SuiteScript does not support SavedSearch record types. Here is a list of supported types.
You should be able to run this using the above mentioned
var search = nlapiSearchRecord(null, 'customsearch_savedsearch',null,null);
I've used this in my code and haven't had any issues. Make sure you have the right permissions set on the saved search. To start with, set it as Public. And in the Audience, "select all" roles.
Your syntax is correct. However, Saved Search type (also like Budget record) is not scriptable even you are able to create a saved search. That is why you encountered that error. Most likely, those record types listed on the SuiteScript Record Browser are supported. You may check the list here:
***Note: You should log in first to the account..
Production: https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2016_1/script/record/account.html
Sandbox: https://system.sandbox.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2016_1/script/record/account.html
I know this is a bit of an old question, and I came across it in my own attempt to do the same, but I just tried the following with success:
var search = nlapiLoadSearch('savedsearch', 'customsearch_savedsearch');
Seemed a little on the nose, but it did the trick.

Resources