Can a user exclude a keyword in the search results?

For example, can they type “-Adventure” if they want to get results without adventuring words in the search results?

+4
source share
1 answer

Of course! You need to enable the advancedSyntax function , and then it -will be interpreted as before NOT.

index.search('Crazy -Adventure', { advancedSyntax: true }).then(...);

Will search for all objects with Crazyand without Adventure.

+6
source

Source: https://habr.com/ru/post/1663553/


All Articles