SenseNet / sensenet

Open Source Content Services Platform written in .NET
https://sensenet.com
GNU General Public License v2.0
173 stars 112 forks source link

Many errors occur in the log during typing a query in the command palette #2049

Closed kavics closed 2 months ago

kavics commented 7 months ago

When typing a query in the command palette, queries like this are executed per keystroke ('@@@@' is the current text):

/odata.svc/Root?query=@@@@* .AUTOFILTERS:OFF&$top=5&$select=Id,Path,Name,Type,DisplayName,Icon,IsFile,IsFolder,ParentId,Version,PageCount,Binary,CreationDate,Avatar,Description&metadata=no&$inlinecount=allpages

If the desired query is 'Index:42' the following queries are requested (focusing only on the query):

I*
In*
Ind*
Inde*
Index*
Index:*
Index:4*
Index:42*

The last three queries cause exception because the "Index:" is not a simple word but a not completed term. The "Index" is a recognized integer field that is managed by an IntegerIndexHandler. The IntegerIndexHandler cannot parse the asterisk (*) characters and throws an exception e.g.:

Cannot parse the value. FieldName Index, Parser: IntegerIndexHandler, (query:  +(Index:* ) +(InTree: /Root ) .AUTOFILTERS:OFF ) [Line: 1, Col: 11]"

These errors flood the log because every exception appears with the full stack trace.