Re: [Neo4j] Recommended way to index and lookup paired properties

2011-09-18 Thread Mattias Persson
yes, I think it's a good solution (to do a more advanced query) and should
perform well also. Keep in mind that the index will be smaller leaving out
those shadow properties, so there's a benefit there as well.

Den onsdagen den 14:e september 2011 skrev Rick Bullotta<
rick.bullo...@thingworx.com>:
> I think this falls into the category of "best to try it".  I would
simulate a couple million items and see what kind of performance you get in
both scenarios.
>
> -Original Message-
> From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org]
On Behalf Of Aseem Kishore
> Sent: Wednesday, September 14, 2011 3:41 PM
> To: Neo4j user discussions
> Subject: Re: [Neo4j] Recommended way to index and lookup paired properties
>
> Can anyone help w/ this question? =) Thanks!
>
> Aseem
>
> On Thu, Sep 8, 2011 at 9:58 AM, Aseem Kishore wrote:
>
>> Hey guys, quick question on indexing.
>>
>> We track Amazon products in our db, and the way Amazon identifies its
>> products is with an Amazon Standard Identification Number (ASIN). The
only
>> catch is that ASINs are only unique within a particular locale, and
Amazon
>> has a few different locales (e.g. us, uk, de, jp, etc.).
>>
>> Because of this, when we index and lookup Amazon products, we need to
index
>> and lookup with *both* properties together. E.g. we really want to index
the
>> pair.
>>
>> As such -- and because we use Neo4j's auto-indexing -- we created a
shadow
>> "locale+asin" property that sits alongside the regular "locale" and
"asin"
>> properties, and it's a concatenation of the two values,
>> e.g. "us+A123456789". We thus index and perform lookups via this shadow
>> property.
>>
>> Recently, though, I saw that you can query even "exact" indexes with
>> complex Lucene syntax, so in theory, we could ditch the shadow property
and
>> query something like "(locale:us AND asin:A123456789)". Will this be
slower
>> though, if there many items w/ the same locale?
>>
>> Generalizing, then, which of these two routes is the recommended way of
>> indexing paired properties? (Or is there a third way?) Thanks!
>>
>> Aseem
>>
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>

-- 
Mattias Persson, [matt...@neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Recommended way to index and lookup paired properties

2011-09-14 Thread Rick Bullotta
I think this falls into the category of "best to try it".  I would simulate a 
couple million items and see what kind of performance you get in both scenarios.

-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of Aseem Kishore
Sent: Wednesday, September 14, 2011 3:41 PM
To: Neo4j user discussions
Subject: Re: [Neo4j] Recommended way to index and lookup paired properties

Can anyone help w/ this question? =) Thanks!

Aseem

On Thu, Sep 8, 2011 at 9:58 AM, Aseem Kishore wrote:

> Hey guys, quick question on indexing.
>
> We track Amazon products in our db, and the way Amazon identifies its
> products is with an Amazon Standard Identification Number (ASIN). The only
> catch is that ASINs are only unique within a particular locale, and Amazon
> has a few different locales (e.g. us, uk, de, jp, etc.).
>
> Because of this, when we index and lookup Amazon products, we need to index
> and lookup with *both* properties together. E.g. we really want to index the
> pair.
>
> As such -- and because we use Neo4j's auto-indexing -- we created a shadow
> "locale+asin" property that sits alongside the regular "locale" and "asin"
> properties, and it's a concatenation of the two values,
> e.g. "us+A123456789". We thus index and perform lookups via this shadow
> property.
>
> Recently, though, I saw that you can query even "exact" indexes with
> complex Lucene syntax, so in theory, we could ditch the shadow property and
> query something like "(locale:us AND asin:A123456789)". Will this be slower
> though, if there many items w/ the same locale?
>
> Generalizing, then, which of these two routes is the recommended way of
> indexing paired properties? (Or is there a third way?) Thanks!
>
> Aseem
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Recommended way to index and lookup paired properties

2011-09-14 Thread Aseem Kishore
Can anyone help w/ this question? =) Thanks!

Aseem

On Thu, Sep 8, 2011 at 9:58 AM, Aseem Kishore wrote:

> Hey guys, quick question on indexing.
>
> We track Amazon products in our db, and the way Amazon identifies its
> products is with an Amazon Standard Identification Number (ASIN). The only
> catch is that ASINs are only unique within a particular locale, and Amazon
> has a few different locales (e.g. us, uk, de, jp, etc.).
>
> Because of this, when we index and lookup Amazon products, we need to index
> and lookup with *both* properties together. E.g. we really want to index the
> pair.
>
> As such -- and because we use Neo4j's auto-indexing -- we created a shadow
> "locale+asin" property that sits alongside the regular "locale" and "asin"
> properties, and it's a concatenation of the two values,
> e.g. "us+A123456789". We thus index and perform lookups via this shadow
> property.
>
> Recently, though, I saw that you can query even "exact" indexes with
> complex Lucene syntax, so in theory, we could ditch the shadow property and
> query something like "(locale:us AND asin:A123456789)". Will this be slower
> though, if there many items w/ the same locale?
>
> Generalizing, then, which of these two routes is the recommended way of
> indexing paired properties? (Or is there a third way?) Thanks!
>
> Aseem
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Recommended way to index and lookup paired properties

2011-09-08 Thread Aseem Kishore
Hey guys, quick question on indexing.

We track Amazon products in our db, and the way Amazon identifies its
products is with an Amazon Standard Identification Number (ASIN). The only
catch is that ASINs are only unique within a particular locale, and Amazon
has a few different locales (e.g. us, uk, de, jp, etc.).

Because of this, when we index and lookup Amazon products, we need to index
and lookup with *both* properties together. E.g. we really want to index the
pair.

As such -- and because we use Neo4j's auto-indexing -- we created a shadow
"locale+asin" property that sits alongside the regular "locale" and "asin"
properties, and it's a concatenation of the two values,
e.g. "us+A123456789". We thus index and perform lookups via this shadow
property.

Recently, though, I saw that you can query even "exact" indexes with complex
Lucene syntax, so in theory, we could ditch the shadow property and query
something like "(locale:us AND asin:A123456789)". Will this be slower
though, if there many items w/ the same locale?

Generalizing, then, which of these two routes is the recommended way of
indexing paired properties? (Or is there a third way?) Thanks!

Aseem
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user