Skip to content
Snippets Groups Projects
Commit 717c8993 authored by Nick Thomas's avatar Nick Thomas
Browse files

Support advanced search syntax

parent 07829763
No related branches found
No related tags found
1 merge request!27Support advanced search syntax
Loading
Loading
@@ -417,10 +417,10 @@ module Elasticsearch
query: {
bool: {
must: [{
multi_match: {
simple_query_string: {
fields: fields,
query: query,
operator: :or
default_operator: :or
}
}]
}
Loading
Loading
@@ -478,9 +478,9 @@ module Elasticsearch
query: {
bool: {
must: {
multi_match: {
simple_query_string: {
query: query,
operator: :and,
default_operator: :and,
fields: [ 'blob.content', 'blob.file_name' ]
}
}
Loading
Loading
Loading
Loading
@@ -63,6 +63,13 @@ describe TestRepository do
expect(found_version_file).to be_truthy
end
 
it "supports advanced search syntax" do
repo.index_blobs
TestRepository.__elasticsearch__.refresh_index!
expect(repo.search('def +(popen | username_regex)')[:blobs][:total_count]).to eq(2)
end
it "indexes specified commits" do
repo.index_commits(
from_rev: '40f4a7a617393735a95a0bb67b08385bc1e7c66d',
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment