CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2003
    Location
    Republic of Ireland
    Posts
    383

    Indexing Service and regex

    Hi All,
    I have problem while querying indexing service. I can run query using regular expression like this
    Code:
    {prop name=filename}{regex}|[0-9].doc{/regex}
    But it looks like it doesn’t work while trying use redex on contents fo files which is exactly what I wan to do. Search for files that contains given pattern
    Even something as simple as
    Code:
    {prop name=Contents}{regex}.*{/regex}
    Doesn’t work.
    Any ideas how can I run search for given pattern inside files? Any suggestions are welcome.

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Indexing Service and regex

    If you are using an expression query, you should have a # in front of Contents. Give that a try.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Dec 2003
    Location
    Republic of Ireland
    Posts
    383

    Re: Indexing Service and regex

    Alas. I've tried it (MS calls it Dialect 1 - my samples are in Dialect 2) and nothing has changed. Is it possible that regular expressions can't be used with Contents property?

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    Re: Indexing Service and regex

    That could be the case. You may have to stick with {freetext} text {/freetext} to accomplish what you want. Freetext allows you to take the words out of order. Using {phrase} text {/phrase} does not.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  5. #5
    Join Date
    Dec 2003
    Location
    Republic of Ireland
    Posts
    383

    Re: Indexing Service and regex

    Yes, but I want to use regular expressions. Alas I have found in documentation something that seems to close the case.
    Regular expressions are sets of symbols that you use to create queries to match property values in properties other than Contents and All.
    Still can't understand why, but obviously what I want to achieve can not be done using indexing service. Appreciate your effort. Thanks.

  6. #6
    Join Date
    May 2002
    Posts
    10,943

    Re: Indexing Service and regex

    Yeah, I just came across that as well. Sorry that there isn't anything more.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured