How to search Notes for a specific word

Is this possible? I don’t seem to be able to figure out how to filter ‘Notes’ by a specific character string. I have been up and down the manual, Advanced Search options, AOD settings, etc - but don’t seem to be able to figure out how to find all ‘Notes’ containing a key word. I am using Version 7.9.7

Only a few select fields are included in the Global search indexing. I think you can make a field searchable, so maybe you can find a way to make the Notes’ content searchable. I’m not sure how. Perhaps in Studio / Notes / Fields? Or in the vardefs?..

1 Like

Hi pgr,

Thanks again for your suggestion.
I found another possible solution and was wondering if you have come across it. It deals with yet another concept I have no experience with.

The comment number is #5847. Title: Full-text search?

It is from a while back, so I am wondering if it still valid.

Any chance you could take a look?

Much appreciate it!

Thanks,
Greg

Is your Global search working at all? Did you set up your Scheduler Jobs in cron?

See Admin / Schedulers, bottom of screen

Hi pgr,

I have not, so I did as outlined in Admin/Schedule:

In order to run SuiteCRM Schedulers, edit your web server user’s crontab file with this command:
sudo crontab -e -u www-data
… and add the following line to the crontab file:

          • cd /var/www/html/InuitGalleryOfVancouverCRM; php -f cron.php > /dev/null 2>&1 
            

BTW, do I need all those leading asterisks? I assume the task I need to run is “Perform Lucene Index”.
The task by default is set to run on the hour (On the hour; 00:00), waited to get over the hour mark. Still no luck.

As before, the search by a character string only finds matches in Subject part of the Note(s); and ONLY if the Subject text begins with that string. :frowning:

Am I missing anything else? There were no entries in Job Log for the task after the time rolled over the hour mark. Is there a way to force it to run to make sure it did? When I go back to Admin/Schedule it still asks me to do the “…In order to run …”.

Thanks
Greg

Hi pgr,

I did some more searching and found and followed the guide here https://docs.suitecrm.com/blog/scheduler-jobs/

So I did all the steps, including Ubuntu Server specific crontab edits and set the timezones in both php.ini files. (date.timezone=“America/Los_Angeles”) (Could running in VirtualBox have anything to do with it?)

Still nothing other then the usual results.

suitecrm.log:
Wed Feb 28 15:01:15 2018 [2746][1][FATAL] Job e135e88c-f109-16c1-d49b-5a97341c7113 (Perform Lucene Index) failed in CRON run

When I do a test search by a test string “Abra”, imbedded in some Notes, I get this in the suitecrm.log:

Wed Feb 28 15:06:57 2018 [2703][1][FATAL] Exception handling in /var/www/html/InuitGalleryOfVancouverCRM/include/MVC/Controller/SugarController.php:402
Wed Feb 28 15:06:57 2018 [2703][1][FATAL] Exception in Controller: File ‘modules/AOD_Index/Index/Index/segments_427o’ is not readable.
Wed Feb 28 15:06:57 2018 [2703][1][FATAL] backtrace:
#0 /var/www/html/InuitGalleryOfVancouverCRM/modules/AOD_Index/Lib/Zend/Search/Lucene/Storage/Directory/Filesystem.php(359): Zend_Search_Lucene_Storage_File_Filesystem->__construct(‘modules/AOD_Ind…’)
#1 /var/www/html/InuitGalleryOfVancouverCRM/modules/AOD_Index/Lib/Zend/Search/Lucene.php(412): Zend_Search_Lucene_Storage_Directory_Filesystem->getFileObject(‘segments_427o’)
#2 /var/www/html/InuitGalleryOfVancouverCRM/modules/AOD_Index/Lib/Zend/Search/Lucene.php(570): Zend_Search_Lucene->_readSegmentsFile()
#3 /var/www/html/InuitGalleryOfVancouverCRM/modules/AOD_Index/AOD_Index.php(342): Zend_Search_Lucene->__construct(‘modules/AOD_Ind…’)
#4 /var/www/html/InuitGalleryOfVancouverCRM/modules/AOD_Index/AOD_Index.php(74): AOD_Index->getLuceneIndex()
#5 /var/www/html/InuitGalleryOfVancouverCRM/modules/Home/UnifiedSearch.php(225): AOD_Index->find(‘abra’)
#6 /var/www/html/InuitGalleryOfVancouverCRM/modules/Home/UnifiedSearch.php(83): doSearch(Object(AOD_Index), ‘Abra’, 0, 20)
#7 /var/www/html/InuitGalleryOfVancouverCRM/include/MVC/View/SugarView.php(791): include_once(’/var/www/html/I…’)
#8 /var/www/html/InuitGalleryOfVancouverCRM/include/MVC/View/views/view.classic.php(74): SugarView->includeClassicFile(‘modules/Home/Un…’)
#9 /var/www/html/InuitGalleryOfVancouverCRM/include/MVC/View/SugarView.php(199): ViewClassic->display()
#10 /var/www/html/InuitGalleryOfVancouverCRM/include/MVC/Controller/SugarController.php(432): SugarView->process()
#11 /var/www/html/InuitGalleryOfVancouverCRM/include/MVC/Controller/SugarController.php(375): SugarController->processView()
#12 /var/www/html/InuitGalleryOfVancouverCRM/include/MVC/SugarApplication.php(105): SugarController->execute()
#13 /var/www/html/InuitGalleryOfVancouverCRM/index.php(52): SugarApplication->execute()
#14 {main}

Arghhh… this is little more than I can understand.

Do you see anything I missed?

Thanks again,
Greg

You’re on the right track.

I believe your Scheduler jobs are running properly, yes. This means cron.php is launching properly every minute, and so the list of jobs in Admin / Schedulers is operational.

However the Indexing job is failing. This seems to be due to file permissions problems in its directory. When you edited the “www-data” user’s crontab, are you sure it worked with that user? Is that the user your applying with “chown” when setting permissions? (it should be your web server user: and on Ubuntu it is normally www-data)

Please try these procedures to restart the process.

https://pgorod.github.io/Reindex-AOD/

Make sure you have appropriate ownership/permissions on those directories so that the indexer can write there.

Hi prg,

Thank you for being so patient. I was wondering if you can help me with this next step in re-indexing AOD.

“… backup (by exporting) and then delete all rows from SQL tables aod_index and aod_indexevent. …”

I am not at all versed in SQL. I can do just about everything else on the list but the raw SQL statements. Would you please be so kind to spell those out ( are those written up elsewhere I have not found yet )?
I figured out how to log in to MySQL from the command line, but the thought of deleting content by experimenting with SQL really scares me.
Also, how do I restore if need to, or do I just save/reload VirtualBox copy before attempting this?

Thanks,
Greg

If you have phpMyAdmin access, you can go in “Export” and dump the entire database (use default options, SQL format). This gives you extra security.

Then in the tables (aod_index, aod_index_event) you can select “Operations” and then “Empty table (TRUNCATE)”

This can be done from mysql command line also, but I suggest getting phpMyAdmin operational, if you don’t already have it, it’s very useful.

1 Like

Hi pgr,

Thanks again for all your advice. I have implemented your suggestions and the Global Search works now, albeit only in the “Advanced Mode”. All I need to do is make it usable for our purposes. I searched through all of the forum posts by various variations of " Customize + Global + Search " but could not find an answer I could use. So I am wondering if you could take a couple of minutes and maybe steer me in the right direction again.

When viewing the results, how do I make “Advanced Search” bar fields act as sorters just like with the “Basic Search” bar? Ie /\ and / beside Subject, Contact etc.
When viewing the results, how do I add/remove another field to/from the “Advanced Search” bar?
How do I add a custom filter to the “Advanced Search” bar - just like the “Basic Search” bar has (although it is non-functional)?

Some observations:

  • The “Basic Search” still finds finds only the results where the search string is the first word in the subject line. Maybe this is normal.
  • The “Basic Search” displays a non-clickable “FIlter” and “List” icons.
  • The “Advanced Search” returns hits from “Contacts” and “Notes” even though in Admin/Global Search I have only the “Notes” selected in “Enabled Modules”.

I was going to attach some screen grabs, but for some reason I don’t seem to be able to attach images at the moment :-((

Do my descriptions make sense?

Thanks again,
Greg

A few extra tips that might help you:

  • you can use a % character as wildcards in the searches, so for example if you have a contact named Fred Smith, searching for Smith won’t find him, but searching for %Smith will.

  • you can set any field to be “searchable” in Studio

Apart from this, I don’t know much else about Search, and I don’t know how to customize the search results screen like you ask. I guess you will have to find the place in the code where it is built and start coding it… sorry.

P.S. - you can put screenshots on https://pasteboard.co

Hi pgr,

Thank you for all your help with my questions.

Greg