Is it possible to form an Endeca query to retrieve a field that must start with certain letters? Say like get all users who's first letter is A
? I checked with Range filters but it is supporting only numerical fields as well as Wild card search. But nothing worked well so far.
How to form an Endeca query where a field must start with certain letters
2.1k Views Asked by Ananth Duari AtThere are 3 best solutions below

Have you tried the First relevance rank module which is supposed to rank based on proximity to the beginning of the field?
It sounds similar to what you are looking for and together with a wild card may produce your intended results.

Endeca at it's current version (6.1) does not have a search filter that works like a "startswith" function in other programming languages.
I do have two options that might possibly get you close:
If you are truly only looking for the first letter you can setup a Dimension value for each letter of the Alphabet (A,B,C...). You can then refine on each letter and see only the values that start with letter A, B, C, etc. The only downside to this is you can only filter based on how many dimension values you setup. So if you added "A", you couldn't filter anything that started with "AB". You could go down the line and add "AB", "BA, "CA", and so on but that would get unwieldy very fast.
If you want something closer to a "startswith" function the only other option is to use a wildcard search. Basically you would do a property search like this:
N=0&Ntk=Username&Ntt=ab*
The trick with wildcard searching is it will do that across multiple words in that property. So assuming you had a data set of these values:
- Smithers Smith
- Larry Smith
- Jenna-Smith
Doing a search of
sm*
would actually return all 3 results because "sm" was in their last name. Even the one with the dash would return as Endeca think's that is a seperate word. (It might be possible to turn that off though, not sure).So basically it comes down to this: Stick a one word in a property, set that property to allow wildcard search, then do a "blah*" against that property and you should have the results you're looking for.
Creating a dimension is one way of approaching the problem as Paul Lemke mentioned.Wildcard is not an option since the performance overhead as well as irrelevant records. But we solved it using couple of other alternatives.
There is a problem where letters like 'A' are usually stop words in Endeca. We can do you a couple of work around to solve this.