Overview
This document provides some examples about queries made in MFAutonomyConsole. The document is compatible with IDOL version 10.9 and 12.1.
NOTE! Using this document requires basic understanding of IDOL components and terminology
Solution
MFAutonomyConsole
More information about the tool (for M-Files' Partners):
IDOL - MFAutonomyConsole - Public.pdf (Desktop, Web, Mobile)
Monitoring queries
You can monitor queries that go into IDOL from action.log log in frontend server. When you run a query, you will see a line like this:
04/10/2019 14:34:12 [1] 00-Always: ACTION=query&DatabaseMatch=%2A&LanguageType=generalUTF8&anylanguage=TRUE&indexdbname=%2A&maxresults=51&querytimeoutms=5000&text=bentley&SecurityInfo=Njh8yGeYdqu49ysaSgQAwGxg%2F2HizbZ8ZB6AuJyX%2FW8L0bu8pIRlmHOBtCQGB5hgEswD2CcggUUWoVgtf9jwizHdS%2BMwKzo%3D (::1)
To make it more readable, decode it for example in: https://www.url-encode-decode.com/. The result now is:
04/10/2019 14:34:12 [1] 00-Always: ACTION=query&DatabaseMatch=*&LanguageType=generalUTF8&anylanguage=TRUE&indexdbname=*&maxresults=51&querytimeoutms=5000&text=bentley&SecurityInfo=Njh8yGeYdqu49ysaSgQAwGxg/2HizbZ8ZB6AuJyX/W8L0bu8pIRlmHOBtCQGB5hgEswD2CcggUUWoVgtf9jwizHdS+MwKzo= (::1)
What we are particularly interested at are fields' text and text field (latter missing from the example):
text=bentley
Search phrases
Simple, one word search and some remarks about the action.log
MFAutonomyConsole cfg=config_dah.txt a=rawquery text=bentley > q1.xml
This query will search text bentley from the index. It will look from all fields as well as from file contents.
Action.log will show something like below. Engine 0 (Daily) has one document that matches the query.
04/10/2019 14:58:33 [4] 00-Always: Generated ActionId 3ae522c395500a693ebd4824724154529a1fa9a5
04/10/2019 14:58:33 [4] 30-Normal: Engine 2 returned 0 results in 0.002538 seconds.
04/10/2019 14:58:33 [4] 30-Normal: Engine 1 returned 0 results in 0.002676 seconds.
04/10/2019 14:58:33 [4] 30-Normal: Engine 0 returned 1 results in 0.006982 seconds.
04/10/2019 14:58:33 [4] 30-Normal: Completed Action, returning 1 hits
04/10/2019 14:58:33 [4] 30-Normal: Request completed in 8 ms.
Simple search with a wildcard (*)
MFAutonomyConsole cfg=config_dah.txt a=rawquery text=Bentley* > q1.xml
This query will search text bentley[any amount of any letters] from the index. It will look from all fields as well as from file contents.
If the searchable text would include numbers like bentley123, it would not be found, because IDOL has a setting SplitNumbers=true by default. That is to protect the index from bloating. Set SplitNumbers=true, re-index the vault and you can find texts with numbers.
Simple search with multiple words
MFAutonomyConsole cfg=config_dah.txt a=rawquery text="bentley car horse" > q1.xml
This query will return a match if some or the entire query words match.
Exact phrase search
MFAutonomyConsole cfg=config_dah.txt a=rawquery text="\"bentley car\"" > q1.xml
This query will search exact phrase bentley car. Backslash is used for [any amount of any letters] from the index. It will look from all fields as well as from file contents.
Operators
MFAutonomyConsole cfg=config_dah.txt a=rawquery text="car AND horse" > q1.xml
This query will search both, car and horse from the object. They can be in separate fields or even in MetaData and in FileData. Note, that you have to use CAPITAL LETTERS with the operator. Otherwise, it is interpreted as a searchable text.
Operators with phrases and nesting
MFAutonomyConsole cfg=config_dah.txt a=rawquery text="\"race car\" AND horse" > q1.xml
MFAutonomyConsole cfg=config_dah.txt a=rawquery text="(\"race car\" AND Bentley) OR horse" > q1.xml
MFAutonomyConsole cfg=config_dah.txt a=rawquery text="(\"race car\" AND (Bentley OR \"Rolls Royce\")) OR horse" > q1.xml
You can use parenthesis for nesting different segments in the query.
Search from a particular field
If you use MFAutonomyConsole's getcontent command, you can see the indexed content of the object. The content included in the queries are inside <autn:content> block.
Usually, the field number is the ID of the corresponding property. For example in the picture above MFMETA_PV1034 is ID 1034 (Description).
You can search from a particular field by following syntax:
MFAutonomyConsole cfg=config_dah.txt a=rawquery text="people:MFMETA_PV1004" > q1.xml
Use color for searching from multiple fields. You can also use wildcards on the field names.
MFAutonomyConsole cfg=config_dah.txt a=rawquery text="(monarch OR people):MFMETA_PV1004:MFMETA_PV1034" > q1.xml
MFAutonomyConsole cfg=config_dah.txt a=rawquery text="(monarch OR people):MFMETA_PV100*:MFMETA_PV1034" > q1.xml
Finding documents from external repositories
The document from external repository that has not been promoted, has at least two useful fields. <DRETITLE> is the name of the document without extension. <MFFILE_1_ORIG> has the indexed contents of the document.
MFAutonomyConsole cfg=config_dah.txt a=rawquery text="\"tiedosto indeksointiin\":MFFILE_1_ORIG" > q1.xml
The document from external repository that has been promoted, has an index field <MFMETA_MANAGEDID> including object's ID visible in Client.
MFAutonomyConsole cfg=config_dah.txt a=rawquery text="495:MFMETA_MANAGEDID" > q1.xml
Simulating query from M-Files
Sometimes you want to do a query into IDOL as its been made from the M-Files, but without any magic before the result gets to the Client. That way we can tell if the possible issue is in the IDOL or in the M-Files.
To make the query, copy field Text from action.log's corresponding query when the search has been made from the client. Then, decode it as instructed in chapter 2. You will get a relative long query string. As an example, here is the search parameters from the client:
and here is the corresponding, decoded Text parameter:
((((((TOYOTA)) OR ((BENTLEY)))):DRETITLE*:MFMETA_*:MFFILE_*) AND ((((RACECAR))):MFMETA_PV1004:MFMETA_PV1004_*)) AND (( 0MFOT0 ):MFMETA_OT AND ( 0MFOTN ):MFMETA_OT_FLAGS AND ( 0MFOTO ):MFMETA_OT_FLAGS)
Use that in the rawquery surrounded by astrophe and you will get the result directly from the IDOL.
