Class ElasticsearchSearchResult.SearchHit

  • Enclosing class:

    public static class ElasticsearchSearchResult.SearchHit
    extends java.lang.Object
    Concrete result record which matched the query. Similar to SearchHit in ES.
    • Field Summary

      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​java.lang.Object> fields  
      private java.lang.String id  
      private java.util.Map<java.lang.String,​java.lang.Object> source  
    • Constructor Summary

      Modifier Constructor Description
      private SearchHit​(java.lang.String id, java.util.Map<java.lang.String,​java.lang.Object> source, java.util.Map<java.lang.String,​java.lang.Object> fields)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.Object> fields()  
      java.lang.String id()
      Returns id of this hit (usually document id)
      java.util.Map<java.lang.String,​java.lang.Object> source()  
      java.util.Map<java.lang.String,​java.lang.Object> sourceOrFields()  
      (package private) java.lang.Object value​(java.lang.String name)
      Finds specific attribute from ES search result
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • id

        private final java.lang.String id
      • source

        private final java.util.Map<java.lang.String,​java.lang.Object> source
      • fields

        private final java.util.Map<java.lang.String,​java.lang.Object> fields
    • Constructor Detail

      • SearchHit

        private SearchHit​(java.lang.String id,
                          java.util.Map<java.lang.String,​java.lang.Object> source,
                          java.util.Map<java.lang.String,​java.lang.Object> fields)
    • Method Detail

      • id

        public java.lang.String id()
        Returns id of this hit (usually document id)
        unique id
      • value

        java.lang.Object value​(java.lang.String name)
        Finds specific attribute from ES search result
        name - attribute name
        value from result (_source or fields)
      • source

        public java.util.Map<java.lang.String,​java.lang.Object> source()
      • fields

        public java.util.Map<java.lang.String,​java.lang.Object> fields()
      • sourceOrFields

        public java.util.Map<java.lang.String,​java.lang.Object> sourceOrFields()