Ah sorry, didn't look hard enough at your example, OK seems like it
works like it's supposed to for you. The objects end up in #2 like you
want.

I'll get back after stepping through my #6 and #12 and doing some
basic inserts. If I still have problems I'll post a runnable file.

Thanks for the help!

/Henrik



On Wed, Aug 19, 2009 at 10:39 AM, Alexander Burger<a...@software-lab.de> wro=
te:
> On Wed, Aug 19, 2009 at 10:08:03AM +0200, Henrik Sarvell wrote:
>> > Note that the tree root nodes (e.g. {2}) above are always created in f=
ile=3D
>> =A0#1.
>>
>> What exactly do you mean by this?
>
> There are external symbols in the DB which are neither entity objects
> nor btree nodes. They are not under the direct control of the
> application. For example, if you do
>
> =A0 : (show *DB)
> =A0 {1} NIL
> =A0 =A0 =A0+WordCount {2}
>
> there is '{2}' which is the container for the indexes of '+WordCount'
>
> =A0 : (show *DB '+WordCount) =A0 =A0 =A0 =A0 =A0 # Same as (show '{2})
> =A0 {2} NIL
> =A0 =A0 =A0article (1 . {3-2})
> =A0 =A0 =A0word (1 . {3-1})
>
> This says that there are two index trees for '+WordCount': 'article' and
> 'word'. Both contain a single entry (the count '1' in the CAR), and the
> root nodes of the trees are '{3-1}' and '{3-2}'.
>
> You have such a symbol like '{2}' for each entity. They are always
> created in file #1. I addition, each hook object would also create such
> an object, as a hook is an entity with its own local sub-database. Thus,
> when you have hooks, there can be many such objects in file #1.
>
>
>> > Forgot this one. No, 'count' doesn't need to be entered into 'dbs'. It=
 ha=3D
>> s no index and thus does not create external objects.
>>
>> I see but the information itself has to be stored somewhere, obviously
>> in my example above it's there in #1 in my copy pasted step result.
>> However, in your case it's missing from the printouts.
>
> Yes, the information (the value of 'count') is stored in the entity
> object itself.
>
> I did not put a 'count' into the first '+WordCount' object. If I change
> my test example to
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> (class +WordCount +Entity)
> (rel word =A0 =A0 =A0(+Ref +String))
> (rel article =A0 (+Ref +Number))
> (rel count =A0 =A0 (+Number))
>
> (dbs
> =A0 (1)
> =A0 (4 +WordCount +Similarity)
> =A0 (3 (+WordCount word article)) )
>
> (pool "dbx" *Dbs)
>
> (new! '(+WordCount)
> =A0 'word "abc"
> =A0 'article 123
> =A0 'count 7 ) =A0 =A0 # <-- Pass a count value
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> then the '+WordCount' object will have a count
>
> =A0 : (select +WordCount)
> =A0 {2-1} (+WordCount)
> =A0 =A0 =A0article 123
> =A0 =A0 =A0count 7
> =A0 =A0 =A0word "abc"
>
> This number '7' is just stored in the object, id does not need
> additional space for an index tree node.
>
>
>> Could the way I'm inserting new objects matter? I usually do a request
>> followed by several put> to get some extra information into the
>> object, finally I finish with commit.
>
> Yes. Using 'request' (or 'new!') takes care of the right database file.
>
> But if you call 'new' directly, you have to pass the file number
> yourself
>
> =A0 (new (db: +WordCount) '(+WordCount) ...)
>
> If you call (new T '(+WordCount) ...) the object will end up in file #1.
> The index trees, however, will always show up in the right places.
>
> Cheers,
> - Alex
> --
> UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe
>
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to