Skip to Content
author's profile photo Former Member
Former Member

Tricky query for TREX

Hi,

I would like to query TREX for documents that has displaynames starting with a specific letter.

If I have three documents named Apple, Ananas and Different Apples I would like to find the two first when searching for documents having a displayname starting with A.

I have tried a couple of different techniques without any success.

Examples of such queries are:

displayname=a* AND NOT displayname=?a*

displayname=a* AND NOT displayname=a

The thing is I always ends up with all three or none of the documents.

I am writing my own component so I am pretty free when it comes to what I send to TREX.

Is anyone having some nice ideas on this problem?

Thanks,

Pierre

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Nov 24, 2004 at 10:06 AM

    Hi Prierre,

    if you are on EP6 SP2 Patch 5 or NW04 SPS4 or higher, try the following:

    IQueryEntry queryEntry = this.fedSearch.getNewQueryEntry();

    queryEntry.setRowType(IQueryEntry.ROW_TYPE_ATTRIBUTE);

    queryEntry.setTermAction(IQueryEntry.TERM_ACTION_EXACT);

    queryEntry.setPropertyName(AbstractIndex.getDisplayNameAsStringPropName());

    queryEntry.setValue("a*");

    queryEntry.setPropertyOperator(IQueryEntry.PROPERTY_OPERATOR_EQUAL);

    IQueryEntryList queryEntries = ...

    queryEntries.add(queryEntry);

    This should return all documents with displayname starts with a.

    Best regards,

    Thilo

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.