Storing index values in FAST-ESP without modifications - search

first of all I'm totally new to FAST but I already have a couple of issues I need to solve, so I'm sorry if my questions are very basic =)
Well, the problem is that I have a field in the FAST index which in the source document is something like "ABC 12345" (please note the intentional whitespaces) but when stored in the index is in the form "ABC 123456" (please note that now there is a single space).
If I retrieve all the document values then this specific value is OK (with all the whitespaces), my only problem is with the way the value is stored in the index since I need to retrieve and display it to my user just like it appears in the original document, and I don't want to go to the full document just for this value, I want the value that I already have in the index. I think I need to update one of the FAST XML configuration files but I don't have enough documentation at hand in order to decide where to perform the change, index_profile.xml? in the XMLMapper file?

I've found the answer by myself. I'm using a XMLMapper for my collection, all I had to do was to add the ignore-whitespace attribute to the Mapping element and then set this attribute value to "false". This solved the problem and the raw data now when retrieved from the index contains the expected inner whitespaces.
Thanks.

Related

Ignore ID in Attribute Selection

I have a dataset with an unique id for each instance. Now I am running some Attribute Selection on that dataset. Concrete I use the CfsSubsetEval for selecting the relevant attributes.
The problem is that I don't want to include the id in this attribute selection, but I need it later to write out a .arff File (which should contain the id and the selected attributes).
I found some posts which used the FilteredClassifier. But in my case I want to have something like a FilteredAttributeSelection. Something like an exklusive view on the data for the AttributeSelection Algorithm.
Is there a way solving this problem?
Thanks in advance!
I solved the problem by copying the attribute vector (the ids) before the filter. After selecting the attributes I restore it.

What exactly is a Lotus Notes document's "size" field?

Background is that I am trying to eliminate duplicated documents that have arisen (from a rogue replication?) in a huge database - tens of thousands of docs. I am composing a view field that uniquely identifies a document so that I can sort on that field and remove the duplicates via LotusScript code. Trouble is that there is a rich text "Body" field that contains most of the action/variability and you can't (AFAICS) use #Abstract in a view column...
Looking around for an alternative I can see that there is a system variable "size" which includes any attachments size, so I am tentatively using this. I note that duplicated docs (to the eye) can differ in reported size by up to about 30 bytes.
Why the small differences? I can code the LS to use a 30-byte leeway, but I'd like to know the reason for it. And is really 30 bytes or something else?
Probably document's item $Revisions has one more entry. That means that the document was saved one more time.
If the cause of this "copy thousands of documents" accident was replication then you might be lucky that documents contain an item $Conflict. This item contains the DocumentUniqueId of the original document and you could pair them this way.

Orchard CMS - Query based on values from ContentPicker

EDIT: Rephrased issue
I think there is either a bug or I am doing something wrong.
I add a field to the type Blogpost. This field is of type
Contentpicker. I call it Related Page.
Then I create to regular pages (ContentType Page).
I create 4 blogposts. Two blogposts get PageOne as selected value in the RelatedPage field. The other two posts get PageTwo as selected value in the RelatedPage.
Now I create a query with filter ContentType is BlogPost. And a filter with Blog Post.Related Page equals {21} (that is the Id of PageOne).
I would expect to get results BlogPostOne and BlogPostTwo. Instead I don't get results. Actually I wanted the pageid to be retrieved from the page the widget is placed on but couldn't get it to work, so I reduced back to a predefined value instead of dynamic for the filter. But like I said no results.
So is the query wrong and how should I do it then. Or is there a bug with filters for ContentPicker fields.
P.S. I will also submit an issue in Codeplex.
UPDATE
In Tokenizer all the values that contain { } are being seen as tokens and therefore are replaced. The problem is that the Ids of content items in a contentpicker field are stored with accolades. So when having {21} as the value for the filter, 21 gets tokenized and since there is no value for this token the value becomes empty. When skipping the tokenizer it works (while debugging). But one cannot skip the tokenizer, because it is very legitimate that there is a token present.
So I believe there is a bug with either the tokenizer, or the way the ids are stored in the contentitem field for contentpicker. I think it can be solved by changing the contentpicker to store numbers separated with comma's but without the accolades.
have you tried using the alias of the page instead of content id as the identifier? e.g. "/about-us", like you do in the layer rules.

session.evaluate and notesxspdocument

I have question regarding session.evaluate in SSJS. In a keyword document I have some #formula stored which does some conversion of data. Lets say this is would be:
#left(fieldname;2)
If the fieldname contained 'hello' this would result in 'he'. Nothing to fancy here. Now I would like to use this in an xpage.
I wrote a function called executeFormula(doc). I call this function from an action on a xpage. This xpage contains 1 notes document datasource. The function call is
executeFormula(datasource.getDocument(true))
Now for some reason the #formula is never calculated correctly. Do I need to save the document first before I can use session.evaluate(kwFormula,doc) or is the #formula wrong in some way?
p.s. I forgot to mention that this code is working inside a customvalidator
Without seeing the code for the executeFormula(doc) function it is very difficult to know exactly how session.evaluate is being called.
I would suggest taking the function out of the equasion for the moment and create a simple test page with the document source and a simple computed field with the session.evaluate in it so that you can see the result. Given your examples above the computed field would be something along the lines of
session.evaluate("#Left(fieldname;2)",xspDoc.getDocument(true));
Once you get acceptable results back then you can move it into your function and verify that it is working there also.
Don't forget that session.evaluate returns a vector so you may beed to do a .getFirstElement() on the returned value if it is not null.
If you're using it in a custom validator, the values posted from the browser/client haven't updated the data model (in your case, the document) yet. This happens after validation is successful.
I imagine it might work for some fields (e.g. fields that are updated after a successful refresh, or stored fields in an existing document).
Actually no need of mentioning the document, eg:- session.evaluate("#username") is enough.
For yours session.evaluate("#left('hello';2)") will work.,

Why the OnWorkflowItemChanged is different between List and document library?

I am doing a workflow for a document library. I put a OnWorkflowItemChanged, and I want to get the value of the column which is changed. I use the workflowProperties.Item["name"] and use the afterProperties. But when I use the workflowProperties.Item["column name"], I still got the original value. When I use the afterProperties, it's NULL.
Then I make another workflow that is the same as above for a list. I can use the workflowProperties.Item["column name"] to get the new value in OnWorkflowItemChanged.
Has anyone come across this problem before? Can you give me some help?
The question seems to mix up Item with ExtendedProperties. As to why a difference is seen on a List/Document Lib, it might have something to do with versionining or perhaps the internal serialization is different. Anyway, some of my experience is outline below. I hope it may be of use:
Use the GUID (as a Guid object, not a string) to access the Before / After ExtendedProperties field. Using the Display Name in the ExtendedProperties will not work. The documentation on it is wrong. You can use SPList.Fields to go from Display Name to Column ID (Guid).
I bind all "Before" to MyWhatever_PreviousProperties and all "After" to MyWhatever_Properties, only accessing MyWhatever_[Previous]Properties after the appropriate event(s)).

Resources