[Hibernate-JIRA] Created: (HSEARCH-753) fullTextQuery.getResultList().size() != fullTextQuery.getResultSize() when using criteria
by Mathieu Perez (JIRA)
fullTextQuery.getResultList().size() != fullTextQuery.getResultSize() when using criteria
-----------------------------------------------------------------------------------------
Key: HSEARCH-753
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-753
Project: Hibernate Search
Issue Type: Bug
Components: query
Affects Versions: 3.4.0.Final
Environment: hibernate 3.6.4.Final / postgresSQL
Reporter: Mathieu Perez
1) My indexes are up-to-date and optimised
2) I'm aware about this part of documentation: "Like Google, the number of results is approximative if the index is not fully up-to-date with the database (asynchronous cluster for example)."
3) Two types of queries:
3.1) Query with "keyword" (or "below"/"above"/"fromTo")
{code}
QueryBuilder qb = fullTextSession.getSearchFactory().buildQueryBuilder().forEntity( Book.class ).get();
org.apache.lucene.search.Query query = qb
.keyword()
.onFields("title", "subtitle", "authors.name", "publicationDate")
.matching("Java rocks!");
.createQuery();
{code}
In this case, I don't meet any problem:
query.getResultSize() == query.getResultList().size()
3.2) Query with criteria
{code}
Criteria criteria = s.createCriteria( Book.class ).createCriteria('isbn').add(Restrictions.like('XXXXXX'))
Query q = s.createFullTextQuery( luceneQuery ).setCriteriaQuery( criteria );
{code}
In this case, the result is different:
{code}
query.getResultSize() != query.getResultList().size()
{code}
Actually, query.getResultSize() exactly returns the number of Book contained in my Book's table. (select count(*) from Book;) without taking in consideration my criteria.
I don't known if it's really a bug either it's the expected behaviour.
When inspecting the org.hibernate.search.query.engine.impl.HSQueryImpl java class, I realized that
{code}
QueryHits queryHits = getQueryHits( searcher, 0 ) :
{code}
- 3.1) Takes in charge my keyword
- 3.2) Doesn't seem to use my criteria
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 10 months
[Hibernate-JIRA] Created: (HSEARCH-758) create DirectoryManager to handle different I/O aspects of an index
by Sanne Grinovero (JIRA)
create DirectoryManager to handle different I/O aspects of an index
-------------------------------------------------------------------
Key: HSEARCH-758
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-758
Project: Hibernate Search
Issue Type: Improvement
Reporter: Sanne Grinovero
Fix For: 4.0.0.Alpha1
Near-Real-Time Lucene usage requires a coupling between the indexwriter and the indexreaders being used for searches.
Also to make other features simpler we need to manage indexwriters and indexreaders in a more integrated form (Infinispan).
refactor : DirectoryProvider
* make a "DirectoryManager" instead, which is able to provide factories for both IndexReader an IndexWriters
* add utility methods like "getName()"
o (wish I had that in some cases to provide better error messages)
* Instead of trying to foresee all needed methods, the extension point should not be the DirectoryManager interface directly, but have people plug in different aspects.
* This is needed to eventually support:
o Instantiated indexes - HSEARCH-336
o make good use of all new so called "Near-Real-Time" Lucene improvements by having IndexReader and IndexWriter possibly generated by the same service
o reuse the JGroups channel used by the Infinispan Directory as transport for a backend (again, the two components need to interact)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 10 months
[Hibernate-JIRA] Created: (HSEARCH-539) Add Indexing Support(out of the box) For Simple Collections, Like Set<Integer>
by Zach Kurey (JIRA)
Add Indexing Support(out of the box) For Simple Collections, Like Set<Integer>
------------------------------------------------------------------------------
Key: HSEARCH-539
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-539
Project: Hibernate Search
Issue Type: New Feature
Components: mapping
Affects Versions: 3.2.0.Final
Environment: N/A
Reporter: Zach Kurey
>From both the documentation and the Hibernate Search In Action book it was unclear to me that simple collections were not able to be indexed out of the box by just adding a @IndexEmbedded or @Field annotation, and instead require a custom field bridge. When I say simple collection I mean Sets/Lists/Collections of Integer/Double/String/Float/etc. It would seem, given the already advanced indexing support in Hibernate Search, that this really should be a basic out of the box feature as I'm sure most of the folks using Search have had to implement such a bridge at some point.
Note that I could still be missing an non-obvious feature or there may be a good reason for not providing it via @IndexEmbedded or @Field automatically.
To be completely clear I have:
@CollectionOfElements
@JoinTable(name="enrollment_groups", joinColumns={@JoinColumn(name="enrollee_id")})
@Column(name="enrollment_group_id")
@IndexedEmbedded
private Set<String> utilityEnrollmentGroups;
If I were to change this to a group of embedded types, everything gets indexed just fine.
For Hibernate libraries in use I have:
Core: 3.5.2
Search: 3.2.0
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 10 months