Issue
- When using the keyword search, if you use only part of the "description string", the file you are searching for will not appear in the search result. However, when the exact string is input in the name field, the file will appear in search results.
-
Example-
1) Upload a document D1 and put the description as ABC1000A.
2) Use ABC1000 to search document D1.
3) Document D1 will not appear as part of the search result.
3) Edit the document and use ABC1000A in the name and save.
4) Repeat Step 2 document D1 will start appearing in the result.
Environment
- DXP 7.3
- DXP 7.4
Resolution
- This is expected behavior.
Additional Information
-
The way the description and title fields of documents are analyzed is with an English analyzer. When the analyzer tries to parse a non-english term such as ABC1000A, it's unable to do more than keep it as one token: "ABC1000A". Because of this, only exact matches to that token would be able to return it in a search when using standard match queries.
Liferay uses standard match queries on most of its indexed fields in documents. However, there are some notable fields were we additionally include prefix-match queries to gather additional results because we believe these fields are of higher importance.
The Title and User fields are two examples. Prefix-match queries will try to match on the beginning of terms and so will match "ABC1000A" when searching for "ABC1000". (however it would not match "BC1000A") This is why "ABC1000" will return a result if the Title is "ABC1000A". - You may learn more about Configuring The Search Bar here.