compass-lucene

Exception thrown when try to add documents to the lucene index continuously inside the for loop

萝らか妹 提交于 2020-01-06 19:43:09
问题 I’m using “compass-2.2.0” to create a lucene index in MySql database table. This is part of my code to index documents, following Exception thrown when try to add documents to the lucene index continuously inside the for loop. Any workaround to overcome this error? My hosting server is WSo2 Stratoes tomcat based server and Wso2 Stratoes data service server. My program works fime in local tomcat/ mySql servers. This is the sample blog post that I have followed- http://mprabhat.wordpress.com

Searchable index gets locked on manual update (LockObtainFailedException)

风格不统一 提交于 2019-12-20 02:27:14
问题 We have a Grails project that runs behind a load balancer. There are three instances of the Grails application running on the server (using separate Tomcat instances). Each instance has its own searchable index. Because the indexes are separate, the automatic update is not enough keeping the index consistent between the application instances. Because of this we have disabled the searchable index mirroring and updates to the index are done manually in a scheduled quartz job. According to our

Implementing compass

会有一股神秘感。 提交于 2019-12-13 08:39:37
问题 Hi I have to integrate Compass with the Spring. First I thougth to implement the Compass using its core apis, I have also read the documentation but i am not getting some application from where i can learn the process to implement. Can any one provide some links to applications to learn the implementation. Thanks 回答1: Download the 2.2.0 version. The zip file has a samples directory and there are complete examples of compass configuring with spring. I have also provided sample config and code

How do I add an EdgeNGramTokenFilter to a Compass Query?

↘锁芯ラ 提交于 2019-12-13 04:22:07
问题 I am building some auto-complete functionality using compass and I need to add an EdgeNGramTokenFilter to the compass query but I cannot see how I can add it. Is this possible? 回答1: I managed to add the EdgeNGramTokenFilter filter by creating a provider class adding a reference to it in the compass.config.xml file by adding the following line within the <searchEngine> tags <analyzerFilter name="lower" type="EdgeNGramTokenFilterProvider"/> Here is the class: import org.apache.lucene.analysis

Querying lucene tokens without indexing

依然范特西╮ 提交于 2019-12-10 15:33:51
问题 I am using Lucene (or more specifically Compass), to log threads in a forum and I need a way to extract the keywords behind the discussion. That said, I don't want to index every entry someone makes, but rather I'd have a list of 'keywords' that are relevant to a certain context and if the entry matches a keyword and is above a threshold I'd add these entries to the index. I want to be able to use the power of an analyser to strip out things and do its magic, but then return the tokens from

Lucene Query Syntax

自古美人都是妖i 提交于 2019-12-08 03:54:39
问题 I'm trying to use Lucene to query a domain that has the following structure Student 1-------* Attendance *---------1 Course The data in the domain is summarised below Course.name Attendance.mandatory Student.name ------------------------------------------------- cooking N Bob art Y Bob If I execute the query "courseName:cooking AND mandatory:Y" it returns Bob, because Bob is attending the cooking course, and Bob is also attending a mandatory course. However, what I really want to query for is

grails searchable plugin query

╄→гoц情女王★ 提交于 2019-12-07 02:15:13
问题 My Grails app is using the searchable plugin, which builds on Compass and Lucene to provide search functionality. I have two searchable classes, say Author and Book. I have mapped these classes to the search index, so that only certain fields can be searched. To perform a search across both classes I simply call def results = searchableService.search(query) One of the nice features of doing the search across both class simultaneously, is that the results object includes metadata about number

Grails: Lucene, Compass Query Builder and date ranges

大憨熊 提交于 2019-12-02 12:53:05
问题 I have the searchable plugin working with my grails project. I have it indexing 4 different tables at work. Unfortunately, each table has a date field that is named differently. Some are named createdAt, some named publishedOn, etc... Within my search, I need to get items that are within a specific date range out of those fields. Is there a way to do this? I've seen one specific instance in the documentation for the plugin, but it doesn't take into account different field names like I have to