Searching for value based on partial string

Searching for an event frame based on Attribute Value is very useful. I am interested in knowing whether it can be used to search on String values, using only partial strings.

 

This article is quite useful:

https://pisquare.osisoft.com/s/Blog-Detail/a8r1I000000Gv9KQAS/coding-tips-for-using-the-afsearch-in-operator?t=1726547940087

 

But in it it explains that the "In" operator is used for searching for a string value that is in a list of pre-defined values. Does this mean that it can't use wildcard or other pattern matching?

 

I tried it in my own sample code, and it didn't work.

AFSearchValueToken textToken = new AFSearchValueToken("|TEXT_ATTRIBUTE", "*Hello*", AFSearchOperator.In);

I can always load all the AFEventFrames (eg. filter by template first), and then find the matching ones using Linq, but I was hoping for a server-side search.

 

Parents
  • I'm using event frames to allow Operators to capture comments, so the comments are very variable. They wanted a means of searching for text. I've been testing some approaches, and it can be quite slow (test database with 100,000 event frames). The performance issue is (unsurprisingly) in loading the attribute values, but I found that if I constrain the search, it is fast enough (1-4 seconds).

    Thanks for the Hierarchical Enumeration set info - didn't know about those, but they look really useful (for other purposes).

Reply
  • I'm using event frames to allow Operators to capture comments, so the comments are very variable. They wanted a means of searching for text. I've been testing some approaches, and it can be quite slow (test database with 100,000 event frames). The performance issue is (unsurprisingly) in loading the attribute values, but I found that if I constrain the search, it is fast enough (1-4 seconds).

    Thanks for the Hierarchical Enumeration set info - didn't know about those, but they look really useful (for other purposes).

Children
No Data