Free Support Forum - aspose.com

PersonalStorageQueryBuilder and queries by specific keywords

Hi Team,
I am trying to filter in mails containing specific keywords.
Is there a way to pass multiple arguments for searching keyword in pst file using PersonalStorageQueryBuilder. Tried list and using ‘or’ does not seem to work. Also, is text.contains the right way to search if the keyword is either in subject or body? This doesnt seem to work, I get, “Proxy error: pst searching engine does not support “Text” as field name”. Is it possible to get only the filtered mails into new pst file?
Please help me with this

Code:
queryBuilder = PersonalStorageQueryBuilder()
queryBuilder.subject.contains(“Review” or “Error”)

queryBuilder.body.contains(“Review” or “Error”)
messageInfoCollection = folderInfo.get_contents(queryBuilder.get_query())

I also tried creating two instances of queryBuilder i.e. queryBuilder and queryBuilder1 and passing them into get_contents with or in between. That didnt work either.

@spidy007,
Thank you for the questions. I will answer you as soon as possible.

@spidy007,

I added a ticket with ID EMAILNET-40255 to our tracking system. Our development team will investigate this possibility. I will inform you of any news.

Yes, text.contains method must search for a text sample in the headers and body of a message. Could you share the PST file and code example reproducing the error, please?

Please take a look at the next article: Working with Messages in a PST File.