1

I'm using Sitecore 9.1 and SXA 1.8, I implemented search functionality using Search box and Search results OOB SXA components, When I search with a sentence, it only returns the exact match for the whole sentence, If I have search results that contains part of the sentence not the whole, they aren't returned. For example, if I search with "Dragon cars", the returned results must contains the whole query, the results that contains "Dragon" or "cars" are not returned.

4
  • Do you search in a RTE field? or Single Line? Is it Title or Display Name field? Commented Oct 9, 2019 at 9:03
  • I'm searching at only single or multi line fields like Title or Description. Commented Oct 9, 2019 at 9:07
  • Does partial search work in multiline Description field? Commented Oct 9, 2019 at 9:08
  • Yes it works well Commented Oct 9, 2019 at 9:12

1 Answer 1

2

If you are using SXA search renderings, then you are not exactly searching by Title or Description fields. The SXA search is using AggregatedContent computed field (sxacontent in the index) and is using Contains method on it like this:

predicate = predicate.And(i => i.AggregatedContent.Contains(t)); 

where t is the text phrase, you are looking for.

The AggregatedContent will contain the text from Title and Description field so the Contains should give you the results and I'm pretty sure it is working fine. But once again you are searching in the AggregatedContent filed, not Title or Description itself.

Take a look at the item fields and how it looks like in the index:

enter image description here

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.