Omitting search results smart filter

paul higgins asked on February 19, 2020 13:49

Hi i have a smart filter based on nodealiaspath values. The filter is working fine, but i cannot seem to stop it fetching search results into the smart search results. I have tried the syntax -nodealiaspath/Login; as described in the documentation, but still returns content from the path.

Recent Answers


Peter Mogilnitski answered on February 19, 2020 14:13

Not sure about your syntax. Smartsearch- is wrapper on top of Lucene. I think syntax should be NOT nodealiaspath:/Login See the lucene documentation

1 votesVote for this answer Mark as a Correct answer

paul higgins answered on February 19, 2020 22:48

confused the documentation lays out conditional filtering values in the smart search filter as

Examples:

;;All +classname;cms.smartphone;Smartphones +_created;[{%ToSearchDateTime(CurrentDateTime.AddDays(-7))%} TO {%ToSearchDateTime(CurrentDateTime)%}];Past week +_content;product;Results related to products +skudepartmentid;(int)4 OR (int) 6;Products in specific departments +(documenttags{0} OR _content{0});product;Results related to products -(issecurednode:(true) OR requiresssl:((int)1));;Exclude secured pages

where i assume the minus sign is to omit the search value ?

  • The search excludes all results whose value in the field matches the value specified in the second part of the filtering option's definition.
0 votesVote for this answer Mark as a Correct answer

David te Kloese answered on February 20, 2020 12:42 (last edited on February 20, 2020 12:43)

Have you tried just removing the page from being indexed at all?

Either on the page itself:

Image Text

Or on the Index:

Image Text

You could also just exclude all pages of Page Type Custom.Login (or whatever you called it) and make sure that even if you move or rename the page it will not show up..

0 votesVote for this answer Mark as a Correct answer

paul higgins answered on February 21, 2020 09:53

Ok David , thank you i shall try that. Just curious why the omission syntax as described in the documentation is not working.

0 votesVote for this answer Mark as a Correct answer

David te Kloese answered on February 21, 2020 11:04

Hi Paul,

I've spent more time on these type of questions then is good for me... both for your question and in the past ;) .

If your just interested how it works I'd recommend to have a look at LUKE (code.google.com/.../luke/). It's an open source viewer for Lucene indexes. (NOTE: you need to have Java running for this).

apart from it being a quick tool to search your index; check what's actually in your index it also helps explains your syntax.

Luke screenshot

I've tried about a dozen combinations :), but I think it keeps omitting special characters. I think it has something to do with the Analyzer type set on the indexed fields, which ignores special characters.

Since the NodeAliasPath is a base Kentico field I'm not sure you can/want to update that. Kentico's default search probably removes paths from the results instead of the in the query itself.

0 votesVote for this answer Mark as a Correct answer

paul higgins answered on February 21, 2020 14:33

Ok David,

Thanks for the update. I shall look at your previous suggestion.

Best Regards

0 votesVote for this answer Mark as a Correct answer

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