Hi All,
Please advise on how to construct query on the below scenario. i tried multiple aggregations and the query is performing very slow.
- i have 1000s of log file and i am using logstash to index data to elastic search.
- each log file may contain more than 5000 lines
- in my search application , i should allow the user to enter some regex based expression to search with in the file (like .*.+([0-9][0-9]:[0-9][0-9]:[0-9][0-9] [A-Z][a-z]{1,2} [0-9][0-9] 20[0-9][0-9]).+.) , file name (like ABC) and a date range.
- on the first hand , i dont have to display the results with in the file names, instead i just have to display the matching file name.
- when i try with regular boolean queries and aggregations, i am able to achieve the results. but the performance is very slow.
- so i am thinking , if there is a way i can tell elastic search to get only the first occurrence of the regex per file (for the purpose of getting only the file names)? i tried to achieve this in aggregation, but the aggregation is applied on the result set received. this is again impact on performance.
the files are not analyzed.
please help.
thanks