ruby on rails - Tire/Elasticsearch Filtering on Attribute -


So when customers are logged into the app, they should be able to search only in their company so that we Trying to filter name. Although log outlook appears to be correct, but no search results are returned.

  # report.rb def self.search_for_client (Params, Client) Tires Query {load: true, page: parameter [: page], per page: 20) query {string params [: q]} if parameter [: q]. Present? Filter: Word, Client = & gt; Customer End End # reports_controller.rb def full_search @query = params [: q] If current_user.client.nil? @results = report. Search parameters other @ results = report. Search_for_client parameters, current_user Client Title and End # Log Output Curl -X Gate 'http: // Localhost: 9200 / Report / Report / _Shatch? {"Keyword": {"Customer": "ApplelTV Norway"}} "Size": {"query_string": {"query": "thio"}}, "filter" : 20} '   

In fact the main issue was that I was not restarting Elastic service server after indexing. I also touched the search -for_line method.

  # report.rb def self.search_for_client (Params, Client) Tires Query {string params [: q], default_operator: "and"} if the parameter [: q] should be searched by the search (load: true, page: parameters [: page], per_page: 20). Present? {String 'status: active'} End end filter should: word, client = & gt; [Customer] end   

end

  #output curl -X GET 'http: // local host: 9200 / report / report / _ search = size = 20 & amp; ; {"bool": {"must": [{"query_string": {"query": "UT-12-541"}}}}}, "filter": {"word": {"Customer": ["Fabric GDF Suez"]}}, "Size": 20} '   

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -