Commit 36ecb8c5 authored by Dmitry Gruzd's avatar Dmitry Gruzd

Add search by full path field

parent 298ebf6f
---
title: Add advanced search by full path field
merge_request: 50567
author:
type: changed
......@@ -161,7 +161,7 @@ module Elastic
_name: context.name(:blob, :match, :search_terms),
query: query.term,
default_operator: :and,
fields: %w[blob.content blob.file_name]
fields: %w[blob.content blob.file_name blob.path]
}
}
......
......@@ -20,6 +20,7 @@ RSpec.describe Repository, :elastic do
index!(project)
expect(project.repository.elastic_search('def popen')[:blobs][:total_count]).to eq(1)
expect(project.repository.elastic_search('files/ruby/popen.rb')[:blobs][:total_count]).to eq(1)
expect(project.repository.elastic_search('def | popen')[:blobs][:total_count] > 1).to be_truthy
expect(project.repository.elastic_search('initial')[:commits][:total_count]).to eq(1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment