[
https://issues.apache.org/jira/browse/LUCENE-7846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16052720#comment-16052720
]
www.jbigdata.fr commented on LUCENE-7846:
-----------------------------------------
ThK U for this answere.
I'm a newbie in lucune dev, but not in solutions on top of lucene.
I try to "attack" the lucene strorage of ElasticSearch with the java lucene API
to dump its content.
Since there is no document, I modify the source code and try to discover what
kind of data / the indexed documents are stored...
> Nested if-then-else in demo/SearchFiles.java
> --------------------------------------------
>
> Key: LUCENE-7846
> URL: https://issues.apache.org/jira/browse/LUCENE-7846
> Project: Lucene - Core
> Issue Type: Improvement
> Affects Versions: 6.5.1
> Reporter: www.jbigdata.fr
> Priority: Minor
> Labels: easyfix
>
> /demo/src/java/org/apache/lucene/demo/SearchFiles.java
> Line 181-191, nested if avoid the print of title if path is null.
> Document doc = searcher.doc(hits[i].doc);
> String path = doc.get("path");
> if (path != null) {
> System.out.println((i+1) + ". " + path);
> String title = doc.get("title");
> if (title != null) {
> System.out.println(" Title: " + doc.get("title"));
> }
> } else {
> System.out.println((i+1) + ". " + "No path for this document");
> }
> --------------------------------------------------------------------------------------
> unnested if-then-else to print the title even if path is null.
> Document doc = searcher.doc(hits[i].doc);
> String path = doc.get("path");
> if (path != null) {
> System.out.println((i+1) + ". " + path);
> }
> else {
> System.out.println((i+1) + ". " + "No path for this document");
> }
> String title = doc.get("title");
> if (title != null) {
> System.out.println(" Title: " + title);
> }
> else {
> System.out.println((i+1) + ". " + "No title for this document");
> }
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]