Package org.hibernate.search.indexes

Examples of org.hibernate.search.indexes.IndexReaderAccessor.open()


                // search on all indexed fields: generate field list, removing internal hibernate search field name: _hibernate_class
                // TODO: possible improvement: cache the fields of each entity
                SearchFactory searchFactory = fullTextEntityManager.getSearchFactory();
                readerAccessor = searchFactory.getIndexReaderAccessor();
                reader = readerAccessor.open(searchedEntity);
                Collection<String> fieldNames = new HashSet<>();
                for (FieldInfo fieldInfo : ReaderUtil.getMergedFieldInfos(reader)) {
                    if (fieldInfo.isIndexed) {
                        fieldNames.add(fieldInfo.name);
                    }
View Full Code Here


                // search on all indexed fields: generate field list, removing internal hibernate search field name: _hibernate_class
                // TODO: possible improvement: cache the fields of each entity
                SearchFactory searchFactory = txtSession.getSearchFactory();
                readerAccessor = searchFactory.getIndexReaderAccessor();
                reader = readerAccessor.open(searchedEntity);
                Collection<String> fieldNames = new HashSet<>();
                for (FieldInfo fieldInfo : ReaderUtil.getMergedFieldInfos(reader)) {
                    if (fieldInfo.isIndexed) {
                        fieldNames.add(fieldInfo.name);
                    }
View Full Code Here

    assertFalse( indexContainsField( "parents.parents.parents.employees.name" ) );
  }

  private boolean indexContainsField(String fieldName) throws IOException {
    IndexReaderAccessor indexReaderAccessor = getSearchFactory().getIndexReaderAccessor();
    IndexReader indexReader = indexReaderAccessor.open( WorkingPerson.class );
    try {
      for ( AtomicReaderContext leave : indexReader.leaves() ) {
        if ( leave.reader().terms( fieldName ) != null ) {
          return true;
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.