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< [email protected]>: > 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: [email protected] [mailto:[email protected]] 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 <[email protected] >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 > [email protected] > https://lists.neo4j.org/mailman/listinfo/user > _______________________________________________ > Neo4j mailing list > [email protected] > https://lists.neo4j.org/mailman/listinfo/user > -- Mattias Persson, [[email protected]] Hacker, Neo Technology www.neotechnology.com _______________________________________________ Neo4j mailing list [email protected] https://lists.neo4j.org/mailman/listinfo/user

