[arangodb-google] Re: Faceted Search Performance

2017-09-20 Thread Roman Kuzmik
done

-- 
You received this message because you are subscribed to the Google Groups 
"ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to arangodb+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[arangodb-google] Re: Change "_key" attribute name (or delete it as default). ArangoDB data models.

2017-09-20 Thread Victor Caballero
Thanks.


If you want to use only one attribute as the primary key, you will have to 
> rename your `id` attribute to `_key` - maybe in the serialization code?


I know, that was what I wanted to avoid. The thing is that now I am forced 
to have two json serializers, one for the application clients and the other 
for arangodb. I don't think this code duplication is harmful but it adds 
extra work :P .

El miércoles, 20 de septiembre de 2017, 14:16:53 (UTC+2), Wilfried Gösgens 
escribió:
>
> Hi, 
> no, the `_key` attribute can't be changed. 
> However, you can add indices to any attributes of your documents to ensure 
> the uniqueness:
> https://docs.arangodb.com/3.2/Manual/Indexing/IndexBasics.html#hash-index
> If you want to use only one attribute as the primary key, you will have to 
> rename your `id` attribute to `_key` - maybe in the serialization code?
>
> Regarding graphs, as explained at 
> https://docs.arangodb.com/3.2/Manual/Graphs/ - vertices are referenced by 
> their `_key` - via the `_to` and `_from` attributes in edge collections. 
>
> However, ArangoDB gives you lots of freedom how these documents look for 
> the rest, and how they're related to documents in other collections. 
>
> Cheers, 
> Willi
>
>
> On Wednesday, September 20, 2017 at 1:49:43 PM UTC+2, Victor Caballero 
> wrote:
>>
>> Hello,
>>
>> I am new to arangodb and I've come up with two questions.
>>
>> The first one is if it is possible to change the "_key" attribute name. I 
>> mean, my model has objects with an id attribute, which I would like to 
>> expose as a JSON abject with the attribute "id". I have made serializers 
>> for that purpose, which, in fact, have an "id" key. The problem is that 
>> when it comes to saving the object to the arangodb, it ends having to 
>> unique identifiers, namely "id" and "_key". Is it possible to rename or 
>> delete the "_key" attribute for all obejcts?
>>
>> The second question that is maybe related to the first one is about 
>> arangodb data models (document model an graph model). Is it possible to 
>> have a mix of models where a document has a named relationship to another 
>> document in a different collection. As far as I have investigated, it is 
>> possible but, does the vertex id have to be in the "_key" attribute?
>>
>> Thanks,
>>
>> Víctor
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to arangodb+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[arangodb-google] Re: Change "_key" attribute name (or delete it as default). ArangoDB data models.

2017-09-20 Thread Wilfried Gösgens
Hi, 
no, the `_key` attribute can't be changed. 
However, you can add indices to any attributes of your documents to ensure 
the uniqueness:
https://docs.arangodb.com/3.2/Manual/Indexing/IndexBasics.html#hash-index
If you want to use only one attribute as the primary key, you will have to 
rename your `id` attribute to `_key` - maybe in the serialization code?

Regarding graphs, as explained at 
https://docs.arangodb.com/3.2/Manual/Graphs/ - vertices are referenced by 
their `_key` - via the `_to` and `_from` attributes in edge collections. 

However, ArangoDB gives you lots of freedom how these documents look for 
the rest, and how they're related to documents in other collections. 

Cheers, 
Willi


On Wednesday, September 20, 2017 at 1:49:43 PM UTC+2, Victor Caballero 
wrote:
>
> Hello,
>
> I am new to arangodb and I've come up with two questions.
>
> The first one is if it is possible to change the "_key" attribute name. I 
> mean, my model has objects with an id attribute, which I would like to 
> expose as a JSON abject with the attribute "id". I have made serializers 
> for that purpose, which, in fact, have an "id" key. The problem is that 
> when it comes to saving the object to the arangodb, it ends having to 
> unique identifiers, namely "id" and "_key". Is it possible to rename or 
> delete the "_key" attribute for all obejcts?
>
> The second question that is maybe related to the first one is about 
> arangodb data models (document model an graph model). Is it possible to 
> have a mix of models where a document has a named relationship to another 
> document in a different collection. As far as I have investigated, it is 
> possible but, does the vertex id have to be in the "_key" attribute?
>
> Thanks,
>
> Víctor
>

-- 
You received this message because you are subscribed to the Google Groups 
"ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to arangodb+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[arangodb-google] Re: Faceted Search Performance

2017-09-20 Thread Jan
Thanks for the feedback!
Sounds good. I also hope the changes can be integrated into a stable 
version soon.

Best regards
Jan

Am Mittwoch, 20. September 2017 00:54:44 UTC+2 schrieb Roman Kuzmik:
>
> Thanks for a hint!
>
> We have wrote small service faced to calculate facets.
> It split my huge AQL provided above into 5 queries:
>
>- main - to filter, sort and retrieve matching entities:
>   - 
>   
>   LET docs = (FOR a IN Asset
>   
>FILTER a.name like 'test-asset-%'
>   
>SORT a.name
>   
>   RETURN a)
>   
>   RETURN {
>   
>counts: (RETURN {
>   
>  total: LENGTH(docs),
>   
>  offset: 0,
>   
>  to: 5
>   
>}),
>   
>items: (FOR a IN docs LIMIT 0, 5 RETURN a)
>   
>   }
>   
>   - 4 small ones to purely calculate facets:
>   - 
>   
>   LET docs = (FOR a IN Asset
>   
>FILTER a.name like 'test-asset-%'
>   
>   RETURN a)
>   
>   LET attributeX = (
>   
>   FOR a in docs
>   
>COLLECT attr = a.attributeX WITH COUNT INTO length
>   
>   RETURN { value: attr, count: length}
>   
>   )
>   
>   RETURN {
>   
>counts: (RETURN {
>   
>  total: LENGTH(docs),
>   
>  offset: 0,
>   
>  to: -1,
>   
>  facets: {
>   
>attributeX: {
>   
>  from: 0,
>   
>  to: 1000,
>   
>  total: LENGTH(attributeX)
>   
>}
>   
>  }
>   
>}),
>   
>facets: {
>   
>  attributeX: (FOR a in attributeX LIMIT 0, 1000 return a)
>   
>}
>   
>   }
>   
> We run these using Java's 8 Fork/Join and basically execute Map(split into 
> sub-queries)/Reduce(merge results) potentially against ArangoDB cluster.
> We run custom ArangoDB build from Jan's feature branch. And results are 
> pretty impressive.
> Remember, we have started with 140 secs for the full AQL and now we are 
> down to 11 seconds (with sort/filter + skiplist on name) or 4 seconds (w/o 
> soft/filter and 4 facets).
>
> I think, we are satisfied for now :-) and hope this PR will make it to 
> 'master'.
>
> Also, would be awesome to see if AQL-pipeline will be advanced in the 
> future to accomodate more analytical type of queries (facets with 
> sub-facets, ElasticSearch style of sub-grouping, etc)
>

-- 
You received this message because you are subscribed to the Google Groups 
"ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to arangodb+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.