Commit a90e6a08 authored by Kerri Miller's avatar Kerri Miller

Merge branch '292673-add-search-by-full-path' into 'master'

Advanced Search: Search by file path field

See merge request gitlab-org/gitlab!50567
parents ffc1e3ae 36ecb8c5
---
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