go to post Eduard Lebedyuk · Jan 12, 2021 To call @Marc Mundt's code from the terminal you need to execute this: do ##class(Sample.Util).SettingsByNameFunc("Port").%Display()
go to post Eduard Lebedyuk · Jan 5, 2021 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?
go to post Eduard Lebedyuk · Jan 5, 2021 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.
go to post Eduard Lebedyuk · Jan 5, 2021 No, the text is plaintext and does not contain any HTML. highlight function by default highlights with <b>text</b>.
go to post Eduard Lebedyuk · Jan 5, 2021 Went with: SELECT SUM($LENGTH(%iFind.Highlight(Text, :name), '<b>')-1) FROM Post WHERE %ID %FIND search_index("TextIndex",:name) Assumes plaintext.
go to post Eduard Lebedyuk · Jan 5, 2021 Great. This should also work: cursor.execute('SELECT * FROM exp.MD5NoMatch(?,?,?)',('exchange', 'cplx','channel'))
go to post Eduard Lebedyuk · Jan 4, 2021 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
go to post Eduard Lebedyuk · Jan 4, 2021 It would be a response in whatever tool you sent your request.
go to post Eduard Lebedyuk · Jan 4, 2021 If you don't know how to get any part of request/response/session the easiest way is to send your request and execute this code on your server: set %response.ContentType = "html" do ##class(%CSP.Utils).DisplayAllObjects() quit $$$OK It would output HTML page containing all required information. I think %request.Get(name) is what you need.
go to post Eduard Lebedyuk · Jan 3, 2021 It's hardcoded. You can: Use SUBSTRING function Use external xDBC SQL tool, for example DBeaver or DataGrip
go to post Eduard Lebedyuk · Jan 2, 2021 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.
go to post Eduard Lebedyuk · Dec 30, 2020 I don't think this snippet is suitable to be a standalone app tbqh.
go to post Eduard Lebedyuk · Dec 30, 2020 One of the things you can do is to implement a new data model, after all InterSystems IRIS gives you a lot of freedom in data handling. For example, check this community projects: InterSystems IRIS as MongoDB InterSystems IRIS as Redis (Implementation 1, Implementation 2) You can add something else or improve existing MongoDB/Redis implementations