K13 SmartSearch Filter by NodeAliasPath

Anna Pengal asked on February 15, 2025 16:00

I'm setting up smart search for our client site, and they want one of the filters to be by path since they have different "categories" that articles can fall into determined by where they live on the site.

When setting up the filtering by nodealias path it works fine when only one "category" of article is chosen. When you select 2 or more categories it only returns results for the last one selected.

The index is configured with a standard analyzer.

The search text that I pass into the PrepareForPages function ends up looking something like this:

+KEYWORD +nodealiaspath:(/education-and-resources/thought-leadership/blog/* OR /education-and-resources/thought-leadership/podcasts/*)

I have also tried versions that look like this

+KEYWORD +(nodealiaspath:/education-and-resources/thought-leadership/blog/* OR nodealiaspath:/education-and-resources/thought-leadership/podcasts/*)

+KEYWORD +(nodealiaspath:"/education-and-resources/thought-leadership/blog/*" OR nodealiaspath:"/education-and-resources/thought-leadership/podcasts/*")

I am not sure where I'm going wrong. I've also tried the whitespace analyzer and the keyword analyzer, but when choosing those the search itself doesn't work as well.

I've tried inspecting the index with Luke and nodealiaspath is definitely a field in the index and it has the correct paths in it.

I would love to avoid making a new field just for this filter.

Recent Answers


Juraj Ondrus answered on February 17, 2025 13:08

What are the search option allowed for your search? I believe you need to set the SearchParameters to FULL search options so all the syntax is supported in the search query.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.