I used %iFind.Highlight as shown in the docs for highlight function.

Even went to sources and checked if it was a generator maybe - it was not, so I stopped my search for more index-specific option.

Switching to [package name].[table name]_[index name]Highlight() now.

Also how can[package name].[table name]_[index name]Find()  and  ...Rank() be used?

Thank you!

That's exactly what I need. I knew about iKnow relational mappings, but not iFind ones.

If you want to count any kind of match, your highlight trick is probably the nicest way to get at it.

The problem with this approach is:

  • It actually reindexes the source again which takes time
  • It does not seem to be aware of the index so index parameters would be missed as only INDEXOPTION can be passed.

JDBC (docs):

import pandas as pd
import jaydebeapi
cnxn=jaydebeapi.connect("com.intersystems.jdbc.IRISDriver","jdbc:IRIS://localhost:51773/Python",  ["dev", "123"], "/InterSystems/IRIS/dev/java/lib/JDK18/intersystems-jdbc-3.0.0.jar")
Data=pd.read_sql('SELECT 1',cnxn)
cnxn.close()

ODBC (docs):

import pandas as pd
import pyodbc
cnxn=pyodbc.connect(('DSN=ENSEMBLE(PYTHON);UID=dev;PWD=123'),autocommit=True)
Data=pd.read_sql('SELECT 1',cnxn)
cnxn.close()

I would much prefer to simply execute the debugged and more secure class queries that already exist and and have been precompiled.  

Sure, this works too:

SELECT * FROM Class.Query 

That won't return accurate count unfortunately.

Consider a Text value like: ABCD ABC. It would be returned by iFind since ABC is in this text, however $Find would return 2 - incorrect number of ABC instances. More advanced iFind variants do additional text/term processing so I'd like to use it.

Additionally I know it's possible as there is highlight function so iFind can determine a number of search term occurrences in a string and highlight them, but I only need to return the number of occurrences.

I can highlight and count <b>,  but I wonder if a better solution exists.