kasakrisz opened a new pull request #18: AMBARI-24847 - Logsearch: Cannot 
search for a term that includes spaces or dashes
URL: https://github.com/apache/ambari-logsearch/pull/18
 
 
   # What changes were proposed in this pull request?
   
   - On Logsearch UI if a sentence like "Some terrible error has happened" is 
used for message filtering a huge amount of irrelevant log entries is pulled, 
this is mainly because the search term is tokenized and finds every line that 
contains any of the words.
   - The UI replaces all whitespace characters in the search terms to `+` char. 
It is a boolean operator: The `+` symbol (also known as the "required" 
operator) requires that the term after the `+` symbol exist somewhere in a 
field in at least one document in order for the query to return a match.
   - Special solr query characters can not be used in search terms because the 
log_message field is tokenized by StandardTokenizer and it eliminates the 
special characters.
   
   Fix.: 
   - switch to WhiteSpaceTokenizer for log_message field.
   - do not replace whitespace chars in the search term on the UI
   - phrase search terms can be specified using `"` like:
   ```Message:"Some terrible error has happened (line:42)"```
   
   Integration tests for query converters are added.
   
   ## How was this patch tested?
   
   UTs and ITs re passed
   Manually:
   
   1. Deploy ambari and a cluster: logsearch, zookeeper, infra solr
   2. Login to Logsearch and performs searches: specify search term for the 
Message field
   3. Check the result contains only the relevant entries

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to