-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Indexing list
PostPosted: Tue Dec 28, 2010 9:20 am 
Newbie

Joined: Thu Dec 16, 2010 1:03 pm
Posts: 4
Hello,

if a Bank class contains Agencies and each Agency one bank.
If agencies are indexed and keyword references a bank, the result of my research has given me all the agencies of the bank and not the bank itself. How can I fix this?

Note: The keyword reference in this case the bank but may also reference the name of an agency.

Thank you in advance


Top
 Profile  
 
 Post subject: Re: Indexing list
PostPosted: Tue Dec 28, 2010 1:31 pm 
Newbie

Joined: Thu Dec 16, 2010 1:03 pm
Posts: 4
Oki,
Surely this lack of information.

Environment :
hibernate-search 3.2.1.Final
spring 3.0.4.RELEASE

Entity :

Guichet

Code:
@Entity
@Table(name = "XXX")
@Indexed
@AnalyzerDef(name = "analyzerGuichet",
      tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),
      filters = {
   @TokenFilterDef(factory = ISOLatin1AccentFilterFactory.class),
   @TokenFilterDef(factory = LowerCaseFilterFactory.class),
   @TokenFilterDef(factory = ASCIIFoldingFilterFactory.class)
})
@Analyzer(definition = "analyzerGuichet")
public final class Guichetimplements Serializable {

        @Field(index = Index.TOKENIZED, store = Store.YES)
   @Column(name = "C_NOMGUICHET")
   private String nomGuichet;

...
      @IndexedEmbedded(depth = 1)
      @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
      @JoinColumn(name = "F_IDETABLISSEMENTPRETEUR")
      private OrganismePreteur organismePreteur;

}


OrganismePreteur

Code:
@Entity
@Table(name = "XXX")
public final class OrganismePreteur implements Serializable {

        @Field(index = Index.TOKENIZED, store = Store.YES)
   @Column(name = "C_LIBELLE")
   private String denomination;

...
         @ContainedIn
   @OneToMany(fetch = FetchType.LAZY)
   @JoinColumn(name = "F_IDETABLISSEMENTPRETEUR", nullable = true)
   private Set<Guichet> guichets;
}



Une recherche

Code:
final FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(this.getEntityManager());
final String[] fields = new String[] { "organismePreteur.denomination", "nomGuichet"};
final Analyzer analyzer = fullTextEntityManager.getSearchFactory().getAnalyzer(Guichet.class);
final MultiFieldQueryParser parser = new MultiFieldQueryParser(Version.LUCENE_29, fields, analyzer);
query = parser.parse(mots);
...
... BoolezanQuery for fuzzyQuery ... etc..
FullTextQuery persistenceQuery = fullTextEntityManager.createFullTextQuery(booleanQuery, Guichet.class);
persistenceQuery.getResultList();


If I have a bank named A which has two Agencies , the search "A" reference the two agencies
It looks normal but does not agree with me on big result.

How could I know that referenced the result ?

NOTE : sorry for my english


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.