mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-24 07:48:26 -04:00
fixes search
This commit is contained in:
1 parent
aa3057056f
commit
302bdba150
2 files changed
+3
-3
No files matched your search
+2
-2
@@ -203,8 +203,8 @@ class Crop < ActiveRecord::Base
|
||||
end
|
||||
|
||||
# # Crop.search(string)
|
||||
def self.search(_query)
|
||||
CropSearchService.search
|
||||
def self.search(query)
|
||||
CropSearchService.search(query)
|
||||
end
|
||||
|
||||
def self.case_insensitive_name(name)
|
||||
|
||||
@@ -3,7 +3,7 @@ class CropSearchService
|
||||
def self.search(query)
|
||||
if ENV['GROWSTUFF_ELASTICSEARCH'] == "true"
|
||||
search_str = query.nil? ? "" : query.downcase
|
||||
response = __elasticsearch__.search( # Finds documents which match any field, but uses the _score from
|
||||
response = Crop.__elasticsearch__.search( # Finds documents which match any field, but uses the _score from
|
||||
# the best field insead of adding up _score from each field.
|
||||
query: {
|
||||
multi_match: {
|
||||
|
||||
Reference in new issue
Block a user