mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
- default search query includes 'AND -@NEEDSPARSING:1' unless we have
@NEEDSPARSING in the query
This commit is contained in:
parent
1b7e57b8d0
commit
af918884c9
2 changed files with 11 additions and 3 deletions
|
@ -66,12 +66,20 @@ module LogStash::Net::Clients
|
|||
end
|
||||
|
||||
def search(options)
|
||||
query = options[:query]
|
||||
# Also skip things that need parsing when searching, by default.
|
||||
if !query.include?("@NEEDSPARSING")
|
||||
query = "(#{query}) AND -@NEEDSPARSING:1"
|
||||
end
|
||||
|
||||
puts "Query: #{query}"
|
||||
|
||||
hits_msg = LogStash::Net::Messages::SearchHitsRequest.new
|
||||
hits_msg.log_type = options[:log_type]
|
||||
hits_msg.query = options[:query]
|
||||
hits_msg.query = query
|
||||
search_msg = LogStash::Net::Messages::SearchRequest.new
|
||||
search_msg.log_type = options[:log_type]
|
||||
search_msg.query = options[:query]
|
||||
search_msg.query = query
|
||||
search_msg.limit = options[:limit]
|
||||
search_msg.offset = options[:offset]
|
||||
hits = 0
|
||||
|
|
|
@ -17,5 +17,5 @@
|
|||
<% end %>
|
||||
|
||||
<pre>
|
||||
<%=h @results.sort_by { |r| r[0] }.collect { |r| r[1] }.join("\n") %>
|
||||
<%=h @results.sort_by { |r| r[0] == nil ? 0 : r[0] }.collect { |r| r[1] }.join("\n") %>
|
||||
</pre>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue