I found something out. maybe this is the problem. There is a different file 
location 
for the lucene index when you include lucene using maven dependency than 
using
the lucene in plugin mode. Maybe thats the reason why the cursor is null 
because
he cant find the index files?

Am Dienstag, 10. Juni 2014 17:14:13 UTC+2 schrieb Montrazul:
>
> Yes
>
> Am Dienstag, 10. Juni 2014 17:13:37 UTC+2 schrieb Artem Orobets:
>>
>> Hi Montrazul,
>>
>> Are you trying that with Lucene index?
>>
>> Best regards,
>> Artem Orobets
>>
>> * Orient Technologiesthe Company behind OrientDB*
>>  
>>
>> 2014-06-10 18:03 GMT+03:00 Montrazul <[email protected]>:
>>
>>> Maybe a problem with lucene index?
>>>
>>> Am Dienstag, 10. Juni 2014 14:16:03 UTC+2 schrieb Montrazul:
>>>
>>>> OIndex<?> index = this.graph.getRawGraph().
>>>> getMetadata().getIndexManager().getIndex(indexName);
>>>>  OIndexKeyCursor cursor = index.keyCursor();
>>>>
>>>>
>>>> When i call this the cursor is null.
>>>>
>>>> System.out.println(index.getFirstKey());
>>>>
>>>> getFirstKey() is also null. The index is created, filled and working.
>>>> Its the correct indexname because:
>>>>
>>>> System.out.println(index.getDatabaseName());
>>>> System.out.println(index.getName());
>>>> System.out.println(index.getKeySize());
>>>> System.out.println(index.getSize());
>>>> System.out.println(index.getType());
>>>>
>>>> prints the correct results.
>>>>
>>>> Am Dienstag, 10. Juni 2014 12:31:52 UTC+2 schrieb Artem Orobets:
>>>>>
>>>>> Hi,
>>>>>
>>>>> You can always use Orient API if you don't like SQL.
>>>>>
>>>>> Just get the index from OIndexManager and call com.orientechnologies.
>>>>> orient.core.index.OIndex#keyCursor, then use this cursor to iterate 
>>>>> over keys.
>>>>>
>>>>> This is the most efficient way.
>>>>>
>>>>> Just 
>>>>>
>>>>> Best regards,
>>>>> Artem Orobets
>>>>>
>>>>> * Orient Technologiesthe Company behind OrientDB*
>>>>>  
>>>>>
>>>>> 2014-06-10 12:16 GMT+03:00 Montrazul <[email protected]>:
>>>>>
>>>>>> And when i never ever want to use SQL? ;)
>>>>>> Ofcourse it would be an easy solution but i dont want to break my 
>>>>>> design rules.
>>>>>>
>>>>>> I could do this:
>>>>>>
>>>>>>
>>>>>>    1. Select all vertices of the vertex type
>>>>>>    2. Iterate over the vertices
>>>>>>    3. Get the indexed property of each vertex and store it in a list 
>>>>>>    4. return the list
>>>>>>
>>>>>> But it seems to me to be kinda oversized to just get all elements of 
>>>>>> an index.
>>>>>>
>>>>>> Am Dienstag, 10. Juni 2014 10:13:41 UTC+2 schrieb Artem Orobets:
>>>>>>
>>>>>>> Hi Montrazul,
>>>>>>>
>>>>>>> The simplest way is to use SQL:
>>>>>>>
>>>>>>> SELECT key FROM index:IndexName
>>>>>>>
>>>>>>>
>>>>>>> Best regards,
>>>>>>> Artem Orobets
>>>>>>>
>>>>>>> * Orient Technologiesthe Company behind OrientDB*
>>>>>>>  
>>>>>>>
>>>>>>> 2014-06-10 10:28 GMT+03:00 Montrazul <[email protected]>:
>>>>>>>
>>>>>>>>  Hi,
>>>>>>>>
>>>>>>>> i have two different indices on my vertextype for two different 
>>>>>>>> properties.
>>>>>>>> I found the method:
>>>>>>>>
>>>>>>>> graph.getIndexedKeys(elementClass)
>>>>>>>>
>>>>>>>> Is there a possibility to get all elements of the index i specify?
>>>>>>>> With this method i get all indexedKeys but i just want to get the
>>>>>>>> indexedKeys of one index not of both.
>>>>>>>>  
>>>>>>>> -- 
>>>>>>>>
>>>>>>>> --- 
>>>>>>>> You received this message because you are subscribed to the Google 
>>>>>>>> Groups "OrientDB" group.
>>>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>>>> send an email to [email protected].
>>>>>>>>
>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>
>>>>>>>
>>>>>>>  -- 
>>>>>>
>>>>>> --- 
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "OrientDB" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>> send an email to [email protected].
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>>  -- 
>>>
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "OrientDB" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 

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

Reply via email to