Herd-UI Search Issue
See original GitHub issueHello Team,
I have created business object definition ‘test_bus_def_1’ from Swagger and now I am trying to search it from Herd-UI home page. It’s giving NullPointerException.
Below are the logs -
-
Mar-02-2018 10:29:04.186 [http-nio-8080-exec-10] INFO org.finra.herd.dao.JestClientFactory.getJestClient userId=TRUSTED_USER - Elasticsearch REST Client Settings: scheme=http, hostname=localhost, port=9200, serverUri=http://localhost:9200 Mar-02-2018 10:29:04.837 [http-nio-8080-exec-10] ERROR finra.herd.service.helper.HerdErrorInformationExceptionHandler.logError userId=TRUSTED_USER - A general error occurred. java.lang.NullPointerException at io.searchbox.core.SearchResult.getHits(SearchResult.java:85) ~[jest-common-5.3.3.jar:?] at io.searchbox.core.SearchResult.getHits(SearchResult.java:73) ~[jest-common-5.3.3.jar:?] at io.searchbox.core.SearchResult.getHits(SearchResult.java:65) ~[jest-common-5.3.3.jar:?] at io.searchbox.core.SearchResult.getHits(SearchResult.java:61) ~[jest-common-5.3.3.jar:?] at org.finra.herd.dao.impl.IndexSearchDaoImpl.buildIndexSearchResults(IndexSearchDaoImpl.java:331) ~[herd-dao-0.59.0.jar:?] at org.finra.herd.dao.impl.IndexSearchDaoImpl.indexSearch(IndexSearchDaoImpl.java:299) ~[herd-dao-0.59.0.jar:?] at org.finra.herd.service.impl.IndexSearchServiceImpl.indexSearch(IndexSearchServiceImpl.java:124) ~[herd-service-0.59.0.jar:?] at org.finra.herd.service.impl.IndexSearchServiceImpl$$FastClassBySpringCGLIB$$b380baaf.invoke() ~[herd-service-0.59.0.jar:?]
-
We added below entries in srch_idx table as it was giving error
No active search index found for type BUS_OBJCT_DFNTN/TAG
. -``` insert into srch_idx (srch_idx_nm, srch_idx_type_cd, srch_idx_stts_cd, creat_user_id, actv_fl) values ('test_bus_def_1', 'BUS_OBJCT_DFNTN', 'READY', 'TRUSTED_USER', 'Y'); insert into srch_idx (srch_idx_nm, srch_idx_type_cd, srch_idx_stts_cd, creat_user_id, actv_fl) values ('test_bus_def_1_tag', 'TAG', 'READY', 'TRUSTED_USER', 'Y'); ```
-
Do we have to perform any steps to be able to search from Herd-UI home page?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top GitHub Comments
Tinshuk -
I said it before and will say it again. I love how you dig right in and get things going!
Here’s the story on our search. You probably know from your knowledge of CloudFormation and install that we embed Elasticsearch behind the Herd search endpoints. We have this nicely integrated in our environments but have not yet put some settings and configurations in the open source release.
Unlike #370 with Uploader, this requires multiple configs to get it to work. I am mentioning @DavidBalash who is an expert at the Elasticsearch integration in Herd.
Here is an overview for your information – David will share more details and good default configs and/or detailed instructions for each area:
It’s worth mentioning that we have another team working on including all this config and default settings in a CloudFormation so it’s easy for open source. We’re just not quite there yet – but I am sure you and David can get your instance up and running!
Hi @nateiam , Thanks for your response. Please see my findings Below:
script.inline: true script.stored: true script.file: true
The query generated by libs in Herd uses inline groovy script see the portion of query using script:
"script_score" : { "script" : { "inline" : "_score * (doc['_index'].value == 'bdef_1522162310906' ? doc['tagSearchScoreMultiplier']: 1)", "lang" : "groovy" }
This makes the Global search with filter ‘All’ works fine, but selecting filter ‘Column’ doesn’t work still, see details below:
- Issue with ‘Column’ filter on Herd-UI homepage page global search: When filter for ‘Column’ is enabled on Herd-UI homepage global search the query generated has 3 “multi_match” subqueries with includes the “fields”: [ ] and ES is not able to execute that query:
multi_match" : { "query" : "Price", "fields" : [], "type" : "phrase_prefix", "operator" : "OR", "slop" : 0, "prefix_length" : 0, "max_expansions" : 50, "lenient" : false, "zero_terms_query" : "NONE", "boost" : 1.0 }
Also note that, this setting is read from class “ConfigurationValue.java”
‘ELASTICSEARCH_HIGHLIGHT_FIELDS(“elasticsearch.highlight.fields”, “{"fields": ["*"]}”)’
It also causes exception while creating json object. The lib fasterXml / JSON is not able to parse the object
{\"fields\":
["*"]}` into json and throws exception on method:private HighlightBuilder buildHighlightQuery(String preTag, String postTag, Set<String> match)
in package:herd-dao/src/main/java/org/finra/herd/dao/impl/IndexSearchDaoImpl.java
Code snippet below:
...try { @SuppressWarnings("unchecked") //Code crashes here IndexSearchHighlightFields highlightFieldsConfig = jsonHelper.unmarshallJsonToObject(IndexSearchHighlightFields.class, highlightFieldsValue); highlightFieldsConfig.getHighlightFields().forEach(highlightFieldConfig -> {.....
Hope it helps, please comment if more details is needed. Thank you 😃