3
0

Fix discovery search result

Fix aggregation filter(left side menu filter) matches, added minimum match criteria to match exact string match for search result.
This commit is contained in:
Vivek Patel 2023-02-13 19:53:28 +05:30 committed by Jože Fortun
parent 04eeaddc45
commit e4ef4b9991
2 changed files with 4 additions and 1 deletions

View File

@ -64,7 +64,7 @@ services:
expose: expose:
- "5601" - "5601"
environment: environment:
OPENSEARCH_HOSTS: '["http://project_name-opensearch:9200","http://project_name-opensearch-node2:9200"]' OPENSEARCH_HOSTS: '["http://127.0.0.1:9200"]'
DISABLE_SECURITY_DASHBOARDS_PLUGIN: 'true' # disables security dashboards plugin in OpenSearch Dashboards DISABLE_SECURITY_DASHBOARDS_PLUGIN: 'true' # disables security dashboards plugin in OpenSearch Dashboards
networks: networks:

View File

@ -5,6 +5,7 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/davecgh/go-spew/spew"
"github.com/elastic/go-elasticsearch/v7" "github.com/elastic/go-elasticsearch/v7"
"github.com/elastic/go-elasticsearch/v7/esapi" "github.com/elastic/go-elasticsearch/v7/esapi"
"github.com/go-chi/jwtauth" "github.com/go-chi/jwtauth"
@ -408,10 +409,12 @@ func esSearch(ctx context.Context, log *zap.Logger, esc *elasticsearch.Client, p
// query.Aggregations = (Aggregations{}).encodeTerms(p.aggregations) // query.Aggregations = (Aggregations{}).encodeTerms(p.aggregations)
// } // }
// spew.Dump("query: ", query)
if err = json.NewEncoder(&buf).Encode(query); err != nil { if err = json.NewEncoder(&buf).Encode(query); err != nil {
err = fmt.Errorf("could not encode query: %q", err) err = fmt.Errorf("could not encode query: %q", err)
return return
} }
spew.Dump("buf: ", buf)
log.Debug("searching ", log.Debug("searching ",
zap.String("for", p.title), zap.String("for", p.title),