-->
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.  [ 4 posts ] 
Author Message
 Post subject: Hibernate Search Analyzer
PostPosted: Thu Dec 11, 2014 9:12 am 
Newbie

Joined: Thu Dec 11, 2014 9:10 am
Posts: 2
I am using hibernate search engine in that Trying to use analyzer, but it is giving error of path not found. Consider code:

@AnalyzerDef(name = "applicationanalyzer",
tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),
filters = {

@TokenFilterDef(factory = LowerCaseFilterFactory.class),
@TokenFilterDef(factory = SnowballPorterFilterFactory.class, params = {
@Parameter(name = "language", value = "English")
}),

@TokenFilterDef(factory = SynonymFilterFactory.class, params = {
@Parameter(name = "synonyms", value = "hibernate/search/synonyms.txt"), //resource not found
@Parameter(name = "expand", value = "true")
})

@TokenFilterDef(factory = StopFilterFactory.class, params = {

@Parameter(name ="words", value ="hibernate/search/stopwords.txt"), //resource not found
@Parameter(name="resource_charset", value = "UTF-16BE"),
@Parameter(name ="ignoreCase", value = "true"),
@Parameter(name ="enablePositionIncrements", value = "true")
}),

})

As mention in the code resource not found error for path, the path is from directory resources/hibernate/search/ .

Dependency for hibernate is :



<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search</artifactId>
<version>4.1.1.Final</version>
</dependency>

<!-- Additional Analyzers: -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-analyzers</artifactId>
<version>4.1.1.Final</version>
</dependency>

<!-- Infinispan integration: -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-infinispan</artifactId>
<version>4.1.1.Final</version>
</dependency>

So please give me any suggestion. I tried it for 2 days still not getting.
Thanks.


Top
 Profile  
 
 Post subject: Re: Hibernate Search Analyzer
PostPosted: Fri Dec 12, 2014 4:52 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Hibernate Search tries to find the synonym file in your classpath. Are you sure you have a hibernate/search/synonyms.txt file in your cpasspath. In your case, is resources part of your classpath?

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Re: Hibernate Search Analyzer
PostPosted: Fri Dec 12, 2014 5:08 am 
Newbie

Joined: Thu Dec 11, 2014 9:10 am
Posts: 2
It is an web-based project. Package structure is as follow:

Web Project
*Java Resources: java
-com.searchfacility.domain
-SearchFacilityDetail.java



*src
-dll


-main
-java

-resource

-webapp

-Meta-INF

-pages

-resources
-css
-js
-fonts
-hibernate
-search
-stopword.txt


Top
 Profile  
 
 Post subject: Re: Hibernate Search Analyzer
PostPosted: Fri Dec 12, 2014 8:08 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
For sure the META-INF is not part of the classpath, move your stopwords files to where it would be included in the CP.
Either main/resource or main/java. Double check that the war contains the files too.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.