Try our conversational search powered by Generative AI!

Unified search not taking in account of SearchAttachmentText in testing



In my code I usiing unified search like this

var q = HttpUtility.HtmlEncode(reguestParameters[SearchConstants.SearchQuery]);
            var query = SearchClient.Instance.UnifiedSearchFor(q)
query = query.Track();
            query = query.OrderByDescending(x => x.SearchUpdateDate);
            var result = query.GetResult();

For testing I have added hardcoded text in my index which is

"SearchAttachmentText$$string": "Banana", // this is in FIND index

When I search from my development enviorment and one another enviorment and search for word "Banana" I get result for all the pages where they
have SearchAttachmentText as Banana.

But as I try it on one of the client enviorment I do not get any result back although the data is in FIND index in client's enviornment as well.

This is my client and when I search for "Banana" I do not get any result back. Am I missing something?

Nov 03, 2022 12:05

Check you haven't got any code that only runs when your on local. I.e. IF DEBUG or the environment is set Development in conjunction with SearchClient.Instance.Conventions.UnifiedSearchRegistry .Add<Document>()...or whatever class is represented by your document.

Nov 06, 2022 16:55

I needed to create a new index in my testing enviorment and then re-index. After that it worked,

Nov 10, 2022 8:20
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.