- default search query includes 'AND -@NEEDSPARSING:1' unless we have

@NEEDSPARSING in the query
This commit is contained in:
Jordan Sissel 2009-10-21 02:19:36 +00:00
parent 1b7e57b8d0
commit af918884c9
2 changed files with 11 additions and 3 deletions

View file

@ -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

View file

@ -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>