This link has been bookmarked by 19 people . It was first bookmarked on 04 Sep 2006, by Paweł Kruszewski.
-
12 Jul 10
-
03 Aug 09
-
29 Dec 07
-
21 Aug 07
-
20 Aug 07
-
Let‘s go back to the database example above. If we store all of our documents with an id then we can access that field using the id. As long as we called our id field :id we can do this
index["89721347"]["title"]
Pretty simple huh? You should note though that if there are more then one document with the same id or key then only the first one will be returned so it is probably better that you ensure the key is unique somehow. By setting Index‘s :key attribute to :id, Ferret will do this automatically for you. It can even handle multiple field primary keys. For example, you could set to :key to [:id, :model] and Ferret would keep the documents unique for that pair of fields.
-
-
19 May 07
-
09 May 07
-
03 May 07
-
24 Apr 07
-
21 Feb 07
-
06 Feb 07
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.