1

We are using Endeca to fetch the records since they are huge in number. We have a dataTable at frontend that displays the records fetched from Endeca through Endeca query. Now, when we filter the results based on the checkbox values at frontend, query appends Nrs attribute and get the filtered results. For any chinese or russian or special characters, we encode them and create the query. Example:

N=0&Ntk=All&Ntx=mode+matchall&Ntt=rumtek&Nrs=collection()/record[(customerName="%22RUMTEK%22+LTD.")]&No=0&Ns=,Endeca.stratify(collection()/record[not%20(invoiceDate)])||invoiceDate|1||,Endeca.stratify(collection()/record[not%20(invoiceNumber)])||invoiceNumber|1

In above query, results are fetched based on value "rumtek" and we apply filter by giving value as ""RUMTEK" LTD.". After encoding, filter value is converted to "%22RUMTEK%22+LTD.". This query fetches no result.

Results are fetched when we either give the complete encoded term (like for any chinese word we give encoded value) or any English word. Results are not fetched when give terms containing double quotes(") example "ABC" LTD. or AB&C (AB%26C).

One more issue is:- what if we have made AB as Stop word (words that won't be searched). If we search for AB&C, then would it search the results for AB&C or it world make the entire term as stop word.

Any suggestion will be appreciated.

Thanks in Advance.

zenith
  • 33
  • 8
  • Describe your indexed data (specifically the customerName field) a little more. Why do you want to filter results with a customer name of ""RUMTEK" LTD" and not just "RUMTEK LTD" (i.e. without the extra quotes)? Do you have records with a customerName of ""RUMTEK" LTD"? Do you get results back when you use customerName="RUMTEK+LTD" in your Nrs parameter (i.e without the URL-encoded quotes)? Do you have double quote marked as a Search Character in developer studio? – chairbender Feb 08 '15 at 23:33
  • @chairbender, we have the data with extra double quotes provided by our customer. We don't get the results with "RUMTEK+LTD" since we have no such data and the query is for exact search. We have filter on every column along with the text field to filter. Filtering in text field , we convert the text to wild card search like "*RUMTEK*+*LTD*" using endeca:matches in our query. This fetches us the correct result. – zenith Feb 09 '15 at 07:06
  • To correct above comment, we convert the text to *RUMTEK*+*LTD*. Do we need to add the escape character in endeca to read the special characters (% and "). Thanks for your interest @chairbender, any help is appreciated. – zenith Feb 09 '15 at 07:16
  • What does the record look like that you are trying to find in the index? Does it look like: "RUMTEK" LTD or "RUMTEK"+LTD? Also, do you have any Search Characters indicated in developer studio? – chairbender Feb 09 '15 at 19:19
  • The record looks like "RUMTEK" LTD. We have allowed certain special characters in our interface so that endeca passes (allows) them but that does not include double quotes ("). It includes '&' though. – zenith Feb 11 '15 at 05:20

1 Answers1

0

First, you need to make sure that your Nrs parameter is entirely and properly URL encoded. Second, you need to make sure you properly escape your double quotes because you want to match against them.

As you said, your data contains some record whose customerName property is (without brackets) ["RUMTEK" LTD.]. According to the MDEX Development Guide, to use double quotes as a literal value you need to escape it by prepending it with a double quote character (how confusing!). So, in order to match on this, you would need to have a query string like (separated into lines for readability):

N=0&
Ntk=All&
Ntx=mode+matchall&
Ntt=rumtek&
Nrs=collection()/record[(customerName="""RUMTEK"" LTD.")]&
&No=0&
Ns=,Endeca.stratify(collection()/record[not%20(invoiceDate)])||invoiceDate|1||,Endeca.stratify(collection()/record[not%20(invoiceNumber)])||invoiceNumber|1

Now, it isn't ready yet. You need to URL encode the ENTIRE Nrs parameter value. So it would become:

N=0&
Ntk=All&
Ntx=mode+matchall&
Ntt=rumtek&
Nrs=collection%28%29%2Frecord%5B%28customerName%3D%22%22%22RUMTEK%22%22+LTD.%22%29%5D&
&No=0&
Ns=,Endeca.stratify(collection()/record[not%20(invoiceDate)])||invoiceDate|1||,Endeca.stratify(collection()/record[not%20(invoiceNumber)])||invoiceNumber|1

That should get you what you need without having to resort to wildcard queries.

chairbender
  • 839
  • 6
  • 14
  • I tried double quotes as escape character for my customer name that contained a double quote in it and it worked when I created the query and tested that in Endeca OrangeApp. Thanks a lot for your help !!!! – zenith Feb 27 '15 at 08:47