Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SeMantic Information Logistics Architecture (SMILA) » Creating record with blackboard and saving
Creating record with blackboard and saving [message #551178] Thu, 05 August 2010 14:09 Go to next message
SMILANewBee is currently offline SMILANewBee
Messages: 42
Registered: August 2010
Member
Hello,

I want to create a new record within a Pipelet and saving the record to the blackboard. After that the new record should be find by a search engine. I have created a new id with the IdFactory, create a new record with the coressponding blackboard method, create new literals and call the commit-method of the blackboard for that specific id. But this doesn't work. The new record isn't found by the search engine.

Here is my code:

Quote:

String filename = blackboard.getLiteral(id, new Path("Filename")).getStringValue();
String lastModifiedDate = blackboard.getLiteral(id, new Path("LastModifiedDate")).getStringValue();

IdFactory idFactory = IdFactory.DEFAULT_INSTANCE;
Key newKey = idFactory.createKey(filename, lastModifiedDate);
Id newId = idFactory.createId("file", newKey);

blackboard.create(newId);

Literal newLiteralACount = RecordFactory.DEFAULT_INSTANCE.createLiteral();
newLiteralACount.setIntValue(countChar(content.getStringValu e(), 'a'));
blackboard.setLiteral(newId, new Path("ACount"), newLiteralACount);

Literal newLiteralFilename = RecordFactory.DEFAULT_INSTANCE.createLiteral();
newLiteralFilename.setStringValue(filename);
blackboard.setLiteral(newId, new Path("Filename"), newLiteralFilename);




Can someone help me?
Re: Creating record with blackboard and saving [message #551746 is a reply to message #551178] Mon, 09 August 2010 12:29 Go to previous messageGo to next message
Eclipse User
Originally posted by: juergen.schumacher.attensity.com

Hi Nils,

Am 05.08.2010, 16:09 Uhr, schrieb <nils.thieme@unister.de>:
> Hello,
>
> I want to create a new record within a Pipelet and saving the record to
> the blackboard. After that the new record should be find by a search
> engine. I have created a new id with the IdFactory, create a new record
> with the coressponding blackboard method, create new literals and call
> the commit-method of the blackboard for that specific id. But this
> doesn't work. The new record isn't found by the search engine.
>
> Here is my code:
>
> Quote:
> [...code...]
> Can someone help me?

Sorry for the late answer, the setup for the news server on my new
computer was not yet correct, so I didn't see your post (;

The code looks OK to me. However, you don't need to call the commit method
yourself, that is handled by the framework, but
it also should not cause problems (performance maybe).

Some other reasons for problems I can think of:
Does your pipelet also return the newId as part of the result Id[] of the
process() method?
Usually this ID list is passed to the next pipelet or service in the
workflow and the next pipelet works only with the
IDs passed to it.

Another question: Do you really want to create a new record, or do you
rather want to add additional attributes to the input record?
Most pipelets work this way and do not create new records.

And finally the definition of the search index must contain something for
your new attribute so that Lucene uses it for indexing.

Regards,
Juergen.
Re: Creating record with blackboard and saving [message #551922 is a reply to message #551746] Tue, 10 August 2010 08:04 Go to previous messageGo to next message
SMILANewBee is currently offline SMILANewBee
Messages: 42
Registered: August 2010
Member
Thank you for your answer. It was really the problem of not returning back the id's of the records. So I changed this and now it works Smile. I have added one new field in the lucence files. That works.
But the new attribute isn't shown on the result website. I have recognized that the servlet is iterating over all attributes in the record and print them on the webpage. So theoretically the new attribute must be printed Rolling Eyes .
Re: Creating record with blackboard and saving [message #551927 is a reply to message #551922] Tue, 10 August 2010 08:28 Go to previous message
SMILANewBee is currently offline SMILANewBee
Messages: 42
Registered: August 2010
Member
I solved the problem by adding an <input>-tag in the SMILASearchDefault.xsl file.

[Updated on: Tue, 10 August 2010 08:32]

Report message to a moderator

Re: Creating record with blackboard and saving [message #564804 is a reply to message #551746] Tue, 10 August 2010 08:04 Go to previous message
SMILANewBee is currently offline SMILANewBee
Messages: 42
Registered: August 2010
Member
Thank you for your answer. It was really the problem of not returning back the id's of the records. So I changed this and now it works :). I have added one new field in the lucence files. That works.
But the new attribute isn't shown on the result website. I have recognized that the servlet is iterating over all attributes in the record and print them on the webpage. So theoretically the new attribute must be printed :roll: .
Re: Creating record with blackboard and saving [message #564824 is a reply to message #564804] Tue, 10 August 2010 08:28 Go to previous message
SMILANewBee is currently offline SMILANewBee
Messages: 42
Registered: August 2010
Member
I noticed after a restart of SMILA that the new attribute will be shown in the search results.
Previous Topic:Creating record with blackboard and saving
Next Topic:Crawler - Configuration and behavior
Goto Forum:
  


Current Time: Sun Sep 21 16:29:52 GMT 2014

Powered by FUDForum. Page generated in 0.01720 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software