<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.28.3">
</HEAD>
<BODY>
Hi all,&nbsp;&nbsp; I have setup a MagmaCollection with two indexes. I loaded the initial data and it appeared to be successful.&nbsp;&nbsp; I have the following search:<BR>
<BR>
getMessagesFor: aModule fieldName: aFieldName <BR>
&quot;Retreive message from the database&quot;<BR>
|aReader|<BR>
aReader := (self root at: #fields)<BR>
where:[<BR>
:each |<BR>
(each fieldName at: aFieldName )<BR>
&amp;<BR>
(each moduleName at: aModule)].<BR>
<BR>
^aReader asArray.<BR>
<BR>
For the records loaded initially this works fine.&nbsp; However any records I add in the application do not get retrieved using the above method.&nbsp; But&nbsp; I can recover the new records searching on the fieldName and moduleName separately.&nbsp; So the indexes appear to be correct.&nbsp; Any Suggestions?&nbsp; Am I missing a step?&nbsp; Below I've included more details on the initial setup.&nbsp; Thanks again for your help.<BR>
<BR>
Tim<BR>
<BR>
<BR>
Initial Setup:<BR>
<BR>
myCollection := MagmaCollection new.<BR>
newIndex := MaSearchStringIndex attribute: #fieldName.<BR>
myCollection addIndex: newIndex.<BR>
newIndex := MaSearchStringIndex attribute: #moduleName.<BR>
myCollection addIndex: newIndex.<BR>
<BR>
I added my records using a do loop:<BR>
<BR>
(fields ) do:[ :each |<BR>
myCollection add: each<BR>
].<BR>
<BR>
The resulting collection was written to Magma.<BR>
<BR>
LBCRepository commit:[LBCRepository root at: #fields put: myCollection ].<BR>
<BR>
The addField method in the application is as follows:<BR>
<BR>
LBCRepository class method&gt;&gt; addField: aField<BR>
<BR>
self commit:[(self root at: #fields) add: aField]<BR>
<BR>
</BODY>
</HTML>