nepsilon / search-query-parser

A simple parser for advanced search query syntax
https://www.npmjs.org/package/search-query-parser
MIT License
253 stars 40 forks source link

Include excluded text in offsets object #35

Open sqwk opened 4 years ago

sqwk commented 4 years ago

Negated text snippets are currently extracted and parsed into the exclude object. To preserve the sort order somehow, could they also be included in the offsets object? Probably, with an additional optional boolean property negated or excluded: true.

I would like to build a UI showing tags and keywords for text that the user entered. The offset information is needed to do this, if negated properties are to show up in the same order as the user originally entered them.