on 11-24-2004 8:18 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thilo,
Thanks for the answer.
I am however developing for a Patch 4 portal and I have not been able to get the wanted behaviour with the attached code.
I have created an alternative solution to the problem that creates a rather large query - it works but it is not that nice.
If anyone is interested in this, just let me know.
Cheers,
Pierre
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.