Author Topic: Search context in the SearchEngine Class  (Read 1411 times)

Ferdinand

  • 100 years since I was shot and a war was started
  • Global Moderator
  • *****
  • Posts: 1670
Search context in the SearchEngine Class
« on: May 05, 2015, 03:53:43 PM »
If I use the search bar, the context for the search is the files in the current file window.  (Note:  I'm using the term "context" here rather than "scope", as scope is also used to refer to the metadata fields that will be searched.)

I can't see a way to specify the context for a search triggered in a script, i.e. I can't see how to limit which files are searched, eg current folder, category etc, rather than the entire database.  On the other hand, there are some sophisticated ways to specify the scope for the search, i.e. which fields are searched.

And I right,  or have I missed something?  (I read the help and the sample script carefully several times.)

If that is right, is this BBD, or is this something where you'd consider a FR?

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 30082
Re: Search context in the SearchEngine Class
« Reply #1 on: May 05, 2015, 04:23:33 PM »
The SearchEngine currently always searches the entire database. There is no way to limit the search to specific files.

Alternatively, you can iterate over the files in your 'search scope', checking each file if it first whatever criteria you need.

If you want a change to the Search Engine, add a FR with the specifics.

Ferdinand

  • 100 years since I was shot and a war was started
  • Global Moderator
  • *****
  • Posts: 1670
Re: Search context in the SearchEngine Class
« Reply #2 on: May 06, 2015, 12:35:05 PM »
Well the search can be slow.  It can be made faster by limiting both the scope of files and scope of fields.  So to search the entire DB and then filter for the file scope partly defeats the purpose.  I'll make a FR.