Skip to content

Conversation

@ajroetker
Copy link
Contributor

I've been using regex and a modified term range query for this but it'd be nice to have an existence query for fields specifically especially for dynamically generated queries.

Implement a new query type that matches documents containing a specified field, regardless of the field's value. This is useful for filtering documents based on whether they have a particular field indexed.

  • Add FieldExistsQuery type in search/query/field_exists.go
  • Add FieldExistsSearcher in search/searcher/search_field_exists.go
  • Register query type in ParseQuery for JSON deserialization
  • Export NewFieldExistsQuery constructor

Implement a new query type that matches documents containing a specified
field, regardless of the field's value. This is useful for filtering
documents based on whether they have a particular field indexed.

- Add FieldExistsQuery type in search/query/field_exists.go
- Add FieldExistsSearcher in search/searcher/search_field_exists.go
- Register query type in ParseQuery for JSON deserialization
- Export NewFieldExistsQuery constructor
@ajroetker
Copy link
Contributor Author

Another transient failure?

--- FAIL: TestLatestSnapshotProtected (0.03s)
Error:     rollback_test.go:445: expected 1 persisted snapshot, got 2
FAIL
FAIL	github.com/blevesearch/bleve/v2/index/scorch	46.067s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant