When I search in via AOD, I get 18 times the same search record as a result, same time displayed I have the entry only one time in the crm database but the AOD index seems to duplicate them.
I went to the /modules/AOD_Index/Index/Index directory and see that the user permissions are root in stead of www-data. I tried to change the the permission but after a little while they show up as root again.
I think i made an error with running the sugar cron job as root in stead of www-data user, might this be the cause of the problem, i am now running the cron as www-data. Some insight is appreciated.
Should i rebuilt? as mentioned in post #4094?
To rebuild the Index, delete the Index directory in /modules/AOD_Index and clear the records in aod_index and aod_indexevent. Then your scheduled jobs will rebuild the Indexes (Indices?)
Iād reccommend rebuilding. Those instructions are correct.
18 duplicate results wouldnāt be caused by running cron as root however so this may be a bug in AOD. Is it possible some of the results are deleted records or do all links go through to the same record?
Iāve definitely found that the permissions of the Index matter.
Originally, I set up my cron jobs via crontab -e (as root), but the created index files then had root:root permissions. Editing /etc/crontab and specifying the www-data user created the correct permissions (with the rebuilt indexes).
this is a new data set which has been put in manually by hand and is still small in size, around 600 leads or so and contacts and accounts are still under 100. So never deleted the any records. All records refer to the same when clicked upon.
At present my search is not working I am getting blank screens often,
i have deleted the Index directory in /modules/AOD_Index
but didnāt clear the records in the database yet, which i will soon do.
clear the records in aod_index and aod_indexeven is just a matter of going to phpmyadmin, select the records and press empty I assume?
I am all good now after resetting everything and permission correction search works normal and gives good results.
So now I run into the next issue which is that we have a database with Korean, Japanese and Chinese characters.
but searching in Chinese character doesnāt give any results back. While the standard search returns some results.
Can you give me some guidance how to trouble shoot or investigate this matter.
This is the first release of AOD and, as such, hasnāt been tested with exotic characters. This is something we want to support however and will be a goal for us for future versions. That being said there are some changes you could make to try and add support.
In
modules/AOD_Index/AOD_Index.php
at the start of the getDocumentForBean method adding
I ignored this issue a while but today i have investigated the matter again. I have many duplicates in my search results so i decided to rebuilt the index (delete directory/empty tables of database) and check again. After one hour i ended up with one lead that had been duplicated already 369 times. This particular lead had a typo in the name which i corrected and editing a field seems to cause the duplication. All other leads donāt have duplication errors.
Checking the MySQL database and do a search got me only back one result so the problem is not in the MySQL database.
Next thing I did edit a record, donāt change anything, save it and 10 minutes later, 440 duplicates of that specific lead while unedited leads stay cool at one search result.
The problem is probably my gut feeling in the /modules/AOD_Index/Index/Index files. Permission of the folder is 755 and the files itself have the 666 permissions. Any idea how to further troubleshoot this issue?
public function getDocumentForBean(SugarBean $bean){
Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8Num_CaseInsensitive());
Regarding the duplicates this is a bug.
Indexed items are supposed to be removed from the index when they are updated, this isnāt happening correctly in the current version which causes the duplicates.
This will be fixed in a future version but in the meantime you can replace the remove method in AOD_Index.php with the below:
public function remove($module, $beanId){
$term = new Zend_Search_Lucene_Index_Term($module.' '.$beanId, 'aod_id');
$query = new Zend_Search_Lucene_Search_Query_Term($term);
$hits = $this->getLuceneIndex()->find($query);
foreach ($hits as $hit) {
$this->getLuceneIndex()->delete($hit->id);
}
}
I am happy to report that my search results a good now with the updates given. I have still some Apache errors coming up but not double entries anymore. Thanks for the good work. Search with Chinese/Korean/Japanese characters i was unable to get to work, Apache is complaining about illegal characters.
any updates i am happy to test more info required let me know,