Index Template


(Nicholas Padilla) #1

Hello All!

you can find the code and json examples here:

I am attempting to create an index template using the Java API,
however, I am having difficulty doing so properly. Let me fill the
blanks as to what I am trying to accomplish. I have some json stored
as a string in a MSSQL database. The json represents different forms
in a uniform format. We will have many of these objects with dynamic
data and the Index Type's will be based on the unique formId in the
RDBMS. I would like to query for "datafield" = "First Name" AND
"datavalue"="Nic*". I would only expect any records that matched for
the query. I have seen several locations in the forums that specify
that I need to use a nested type for the 'dataDisplayFields' field and
then construct a NestedQuery that uses the dataDisplayFields.datavalue
and dataDisplayFields.datafield. This way we can ensure we correctly
get the one record with the First Name and Nic*. I would think I
need to use Index Templates so that all indices/types make the
'dataDisplayFields' a nested object, so i can use the NestedQuery.

I am using the JavaAPI in an embedded mode environment and cannot
figure out how to add my template so that all indices/types know that
the 'dataDisplayFields' are of 'nested' type. Any help would be
appreciated, let me know of any questions or comments!

Thanks and Happy Holidays!


(Nicholas Padilla) #2

Sorry, forgot to add the gist: https://gist.github.com/1515839

On Dec 23, 6:01 pm, Nicholas Padilla nicho...@monstersoftwarellc.com
wrote:

Hello All!

you can find the code and json examples here:

I am attempting to create an index template using the Java API,
however, I am having difficulty doing so properly. Let me fill the
blanks as to what I am trying to accomplish. I have some json stored
as a string in a MSSQL database. The json represents different forms
in a uniform format. We will have many of these objects with dynamic
data and the Index Type's will be based on the unique formId in the
RDBMS. I would like to query for "datafield" = "First Name" AND
"datavalue"="Nic*". I would only expect any records that matched for
the query. I have seen several locations in the forums that specify
that I need to use a nested type for the 'dataDisplayFields' field and
then construct a NestedQuery that uses the dataDisplayFields.datavalue
and dataDisplayFields.datafield. This way we can ensure we correctly
get the one record with the First Name and Nic*. I would think I
need to use Index Templates so that all indices/types make the
'dataDisplayFields' a nested object, so i can use the NestedQuery.

I am using the JavaAPI in an embedded mode environment and cannot
figure out how to add my template so that all indices/types know that
the 'dataDisplayFields' are of 'nested' type. Any help would be
appreciated, let me know of any questions or comments!

Thanks and Happy Holidays!


(Shay Banon) #3

The whole template structure is wrong, you just set type to nested in the
map. Read again how templates are used.

On Sat, Dec 24, 2011 at 3:02 AM, Nicholas Padilla <
nicholas@monstersoftwarellc.com> wrote:

Sorry, forgot to add the gist: https://gist.github.com/1515839

On Dec 23, 6:01 pm, Nicholas Padilla nicho...@monstersoftwarellc.com
wrote:

Hello All!

you can find the code and json examples here:

I am attempting to create an index template using the Java API,
however, I am having difficulty doing so properly. Let me fill the
blanks as to what I am trying to accomplish. I have some json stored
as a string in a MSSQL database. The json represents different forms
in a uniform format. We will have many of these objects with dynamic
data and the Index Type's will be based on the unique formId in the
RDBMS. I would like to query for "datafield" = "First Name" AND
"datavalue"="Nic*". I would only expect any records that matched for
the query. I have seen several locations in the forums that specify
that I need to use a nested type for the 'dataDisplayFields' field and
then construct a NestedQuery that uses the dataDisplayFields.datavalue
and dataDisplayFields.datafield. This way we can ensure we correctly
get the one record with the First Name and Nic*. I would think I
need to use Index Templates so that all indices/types make the
'dataDisplayFields' a nested object, so i can use the NestedQuery.

I am using the JavaAPI in an embedded mode environment and cannot
figure out how to add my template so that all indices/types know that
the 'dataDisplayFields' are of 'nested' type. Any help would be
appreciated, let me know of any questions or comments!

Thanks and Happy Holidays!


(Nicholas Padilla) #4

Hey Shay!

Thanks for the response! I have gone over the docs again just to be
sure I understand what templates are for. My understanding has not
changed really, I am specifying a Name for the template when creating
the Request, I am creating a "catch all" expression for the Template
field so that it applies to all indices. I created my map with just
the type = nested and added it using the addMapping call. The mapping
type I was a bit confused on, however, you had told another user that
by using the default type you can apply to all types within an
index. This is what I am trying to accomplish. What part of the
template is syntactically wrong? Which parts do I remove or replace,
does the map need to contain a key 'default' and have a map as the
value to specify the 'type' = 'nested'? Forgive me but I couldn't find
a concrete example using the java API, your code is really clean and
abstracted and easy to use. However, I just can't get its usage
correct on my end. A bit more help, maybe a small example would be
wonderful. Thanks for your precious time and thanks for a wonderful
product!

On Dec 25, 9:39 am, Shay Banon kim...@gmail.com wrote:

The whole template structure is wrong, you just set type to nested in the
map. Read again how templates are used.

On Sat, Dec 24, 2011 at 3:02 AM, Nicholas Padilla <

nicho...@monstersoftwarellc.com> wrote:

Sorry, forgot to add the gist:https://gist.github.com/1515839

On Dec 23, 6:01 pm, Nicholas Padilla nicho...@monstersoftwarellc.com
wrote:

Hello All!

you can find the code and json examples here:

I am attempting to create an index template using the Java API,
however, I am having difficulty doing so properly. Let me fill the
blanks as to what I am trying to accomplish. I have some json stored
as a string in a MSSQL database. The json represents different forms
in a uniform format. We will have many of these objects with dynamic
data and the Index Type's will be based on the unique formId in the
RDBMS. I would like to query for "datafield" = "First Name" AND
"datavalue"="Nic*". I would only expect any records that matched for
the query. I have seen several locations in the forums that specify
that I need to use a nested type for the 'dataDisplayFields' field and
then construct a NestedQuery that uses the dataDisplayFields.datavalue
and dataDisplayFields.datafield. This way we can ensure we correctly
get the one record with the First Name and Nic*. I would think I
need to use Index Templates so that all indices/types make the
'dataDisplayFields' a nested object, so i can use the NestedQuery.

I am using the JavaAPI in an embedded mode environment and cannot
figure out how to add my template so that all indices/types know that
the 'dataDisplayFields' are of 'nested' type. Any help would be
appreciated, let me know of any questions or comments!

Thanks and Happy Holidays!


(Nicholas Padilla) #5

Hello All!

Any help on this? I appreciate any help!

Thanks and Happy New Year!

On Dec 26, 8:29 am, Nicholas Padilla nicho...@monstersoftwarellc.com
wrote:

Hey Shay!

Thanks for the response! I have gone over the docs again just to be
sure I understand what templates are for. My understanding has not
changed really, I am specifying a Name for the template when creating
the Request, I am creating a "catch all" expression for the Template
field so that it applies to all indices. I created my map with just
the type = nested and added it using the addMapping call. The mapping
type I was a bit confused on, however, you had told another user that
by using the default type you can apply to all types within an
index. This is what I am trying to accomplish. What part of the
template is syntactically wrong? Which parts do I remove or replace,
does the map need to contain a key 'default' and have a map as the
value to specify the 'type' = 'nested'? Forgive me but I couldn't find
a concrete example using the java API, your code is really clean and
abstracted and easy to use. However, I just can't get its usage
correct on my end. A bit more help, maybe a small example would be
wonderful. Thanks for your precious time and thanks for a wonderful
product!

On Dec 25, 9:39 am, Shay Banon kim...@gmail.com wrote:

The whole template structure is wrong, you just set type to nested in the
map. Read again how templates are used.

On Sat, Dec 24, 2011 at 3:02 AM, Nicholas Padilla <

nicho...@monstersoftwarellc.com> wrote:

Sorry, forgot to add the gist:https://gist.github.com/1515839

On Dec 23, 6:01 pm, Nicholas Padilla nicho...@monstersoftwarellc.com
wrote:

Hello All!

you can find the code and json examples here:

I am attempting to create an index template using the Java API,
however, I am having difficulty doing so properly. Let me fill the
blanks as to what I am trying to accomplish. I have some json stored
as a string in a MSSQL database. The json represents different forms
in a uniform format. We will have many of these objects with dynamic
data and the Index Type's will be based on the unique formId in the
RDBMS. I would like to query for "datafield" = "First Name" AND
"datavalue"="Nic*". I would only expect any records that matched for
the query. I have seen several locations in the forums that specify
that I need to use a nested type for the 'dataDisplayFields' field and
then construct a NestedQuery that uses the dataDisplayFields.datavalue
and dataDisplayFields.datafield. This way we can ensure we correctly
get the one record with the First Name and Nic*. I would think I
need to use Index Templates so that all indices/types make the
'dataDisplayFields' a nested object, so i can use the NestedQuery.

I am using the JavaAPI in an embedded mode environment and cannot
figure out how to add my template so that all indices/types know that
the 'dataDisplayFields' are of 'nested' type. Any help would be
appreciated, let me know of any questions or comments!

Thanks and Happy Holidays!


(system) #6