OpenSearch/plugins
Nik Everett b8e9a7125f
Speed up empty highlighting many fields (backport of #61860) (#62122)
Kibana often highlights *everything* like this:
```
POST /_search
{
  "query": ...,
  "size": 500,
  "highlight": {
    "fields": {
      "*": { ... }
    }
  }
}
```

This can get slow when there are hundreds of mapped fields. I tested
this locally and unscientifically and it took a request from 20ms to
150ms when there are 100 fields. I've seen clusters with 2000 fields
where simple search go from 500ms to 1500ms just by turning on this sort
of highlighting. Even when the query is just a `range` that and the
fields are all numbers and stuff so it won't highlight anything.

This speeds up the `unified` highlighter in this case in a few ways:
1. Build the highlighting infrastructure once field rather than once pre
   document per field. This cuts out a *ton* of work analyzing the query
   over and over and over again.
2. Bail out of the highlighter before loading values if we can't produce
   any results.

Combined these take that local 150ms case down to 65ms. This is unlikely
to be really useful when there are only a few fetched docs and only a
few fields, but we often end up having many fields with many fetched
docs.
2020-09-08 15:49:50 -04:00
..
analysis-icu upgrade to Lucene-8.7.0-snapshot-61ea26a (#61957) (#61974) 2020-09-04 13:46:20 +02:00
analysis-kuromoji upgrade to Lucene-8.7.0-snapshot-61ea26a (#61957) (#61974) 2020-09-04 13:46:20 +02:00
analysis-nori upgrade to Lucene-8.7.0-snapshot-61ea26a (#61957) (#61974) 2020-09-04 13:46:20 +02:00
analysis-phonetic upgrade to Lucene-8.7.0-snapshot-61ea26a (#61957) (#61974) 2020-09-04 13:46:20 +02:00
analysis-smartcn upgrade to Lucene-8.7.0-snapshot-61ea26a (#61957) (#61974) 2020-09-04 13:46:20 +02:00
analysis-stempel upgrade to Lucene-8.7.0-snapshot-61ea26a (#61957) (#61974) 2020-09-04 13:46:20 +02:00
analysis-ukrainian upgrade to Lucene-8.7.0-snapshot-61ea26a (#61957) (#61974) 2020-09-04 13:46:20 +02:00
discovery-azure-classic Do not create two loggers for DeprecationLogger backport(#58435) (#61530) 2020-08-26 16:04:02 +02:00
discovery-ec2 Simplify adding plugins and modules to testclusters (#61886) 2020-09-03 19:37:46 -07:00
discovery-gce Simplify adding plugins and modules to testclusters (#61886) 2020-09-03 19:37:46 -07:00
examples Merge test runner task into RestIntegTest (7.x backport) (#60600) 2020-08-04 14:46:32 +02:00
ingest-attachment Add data.path fast path for FilePermission (#61302) 2020-09-01 12:03:22 -06:00
mapper-annotated-text Speed up empty highlighting many fields (backport of #61860) (#62122) 2020-09-08 15:49:50 -04:00
mapper-murmur3 Pass SearchLookup supplier through to fielddataBuilder (#61430) (#61638) 2020-08-27 18:09:56 +02:00
mapper-size Make MetadataFieldMapper extend ParametrizedFieldMapper (#59847) (#60924) 2020-08-11 09:02:28 +01:00
repository-azure Add repositories metering API (#62088) 2020-09-08 14:01:04 +02:00
repository-gcs Add repositories metering API (#62088) 2020-09-08 14:01:04 +02:00
repository-hdfs Remove old test mute code (#61277) 2020-08-19 09:40:59 +01:00
repository-s3 Add repositories metering API (#62088) 2020-09-08 14:01:04 +02:00
store-smb [7.x] Convert most OSS plugins from integTest to [yaml | java]RestTest or internalClusterTest (#59444) (#60343) 2020-07-29 13:06:13 -05:00
transport-nio [7.x] Convert most OSS plugins from integTest to [yaml | java]RestTest or internalClusterTest (#59444) (#60343) 2020-07-29 13:06:13 -05:00
build.gradle Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00