Questions regarding controlling IMatch via the WebService

Started by voronwe, April 12, 2021, 05:02:31 PM

Previous topic - Next topic

voronwe

Hi Mario

I tried to get some data from IMatch via the WebService and the first tries lookes very promising.

However, I have these questions so far :

1) In v1/files/query you stated for the query :
This is a complex endpoint that requires additional documentation. See the tutorial links for more info.

Can you give me hint for what I have to search for? Searching for query tutorial in the Online-help was not successfull. I was searching for some examples how to write a query.

2) Is there a way to "remote-control" IMatch? So beside of giving back the filenames from the query, show the files in IMatch?


Greetings
Thorsten

PS: and a third one: When I want to write a third program to get Data from IMatch, do I need Anywhere?  As far as I see the webserver is running anyway. So will Anywhere add some functionallty to the WebService API the pure IMatch does not have, or is it "just" a Frontend? ("Just" because I know it is a lot of work to write something like this.)

(My goal is an application which should have access to the DB)

Mario

1) This is an undocumented endpoint for internal purposes. I have never documented it.
You can achieve the same result by just searching the files in your app, in any way you want.

2) "Show the files in IMatch" meaning what?
You can open a result window (see IMatchLib.js) and examples. This should do what you want.

3) No. But the IMWS in IMatch accepts connections from the same computer. If your other program runs on the same computer as IMatch, it will work just fine.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Jingo

If you are interested in writing an app that will performing a search with result window - check out the Fancy Search app... it might assist you though it doesn't use the query function: https://www.photools.com/community/index.php?topic=9115.0 

Mario

Searching files is quite trivial. Just fetch the data you want to search with v1/files. Then iterate over all files, picking out the files you need.

It becomes more complex if you want to search 200,000 files or a combination of metadata, Attributes and whatnot. Because - data volume.
That's more IMatch territory. But even that would work in an app, since you can page the results of v1/files, to work in batches.

There are also dedicated search endpoints documented, e.g. for file names, keywords and the like.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

voronwe

Hi Mario
thanks a lot for giving the hint with the Fancy Search app, where I found some ideas how to handle it (however, I found out that I'm not very familiar with JavaScript).
But the Python-script (imatch_access.py) gave me a way to test the calls from the outside world - which gave me also an idea how to handle the calls in the application I want to write (which will be an external programm which has access to IMatch, not an App inside IMatch).

However, new questions raises  ;D :

Quote from: Mario on April 12, 2021, 07:29:26 PM
Searching files is quite trivial. Just fetch the data you want to search with v1/files. Then iterate over all files, picking out the files you need.

It becomes more complex if you want to search 200,000 files or a combination of metadata, Attributes and whatnot. Because - data volume.
That's more IMatch territory. But even that would work in an app, since you can page the results of v1/files, to work in batches.

There are also dedicated search endpoints documented, e.g. for file names, keywords and the like.

So far /v1/search/metadata gave me what I was looking for. Of course I would like to write the requests in a way, that IMatch is doing the search for me and I need to display only the results - but let's see how complex it can get.
However, for this request, it is possible to set groups and tags. Is there some place where I can find a list of valid values for this? From the FancySearch I took over 'tags': 'hierarchicalkeywords', which makes the search much more faster, but I'm not sure where to get the correct names, because in ExifTool this would be XMP:Hierarchicalsubject. I'm thinking especially about the "Person In Image" (suprise  :D), but there are also others which I'm currently probably not thinking of.

Second one:

Showing of a search result window works also. I found in the IMatchLib.js the /v1/imatch/resultwindow/open which does it.

For the curiosity: The documentation of   this.openResultWindow states:
 
*      @param {String} [params.layout] The name of the file window layout to use for the new result window.

Are the layout documented somewhere?

But thanks, this was a big step forward





Mario

The tag names and group names are displayed in the The Tag Selector or you use the helpful tag info app from App Manager.
You can also use the Metadata Tag ShortCodes for tags. IMatch always works the same, including the IMWS endpoints.

The file window layout name is the name you see in the File Window layout drop-down - the standard layouts I ship with IMatch or the names you have used for your custom layouts. E.g. "Default".
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

voronwe

Quote from: Mario on April 13, 2021, 10:31:21 AM
The tag names and group names are displayed in the The Tag Selector or you use the helpful tag info app from App Manager.
You can also use the Metadata Tag ShortCodes for tags. IMatch always works the same, including the IMWS endpoints.

The file window layout name is the name you see in the File Window layout drop-down - the standard layouts I ship with IMatch or the names you have used for your custom layouts. E.g. "Default".

Thanks, I will give it a try