One xml for filecopy collection

Hi all,

 

I've got a collection with filecopy type. I managed to make it work fine for a collection with multiple xml. However, I created another similar collection except that all xml are defined in one file.

 

I found in the documentation that this is possible using the configuration "document, path" in xml.cfg

PADRE XML Mapping Version: 2
# Define which element to split documents on
document,/people/person

Indexed fields

T,1,//title

However I'm getting this on the results page

<Results>
<Person>
<Title>
Em P|Dr|Dr|Miss|Prof|Mrs|Mr|Miss|Mr|Ms|Dr|Dr|Dr|Prof|Mr|Mr|Mr|Mr|Dr|Ms|Mrs|Dr|Mr|Ms|Miss|Mr|Dr|Mrs|Dr|Miss|Mr|Mr|Dr|Mrs|Dr|Miss|Mr|Dr|Dr|Dr|Dr|Miss|Mrs|Mr|Mrs|Miss|Dr|Mrs|Mr|Mr|Miss|Mrs|Dr|Dr|Prof|Mr|Miss|Mr|Dr|Dr|Miss|Dr|Mrs|Miss|Mr|Dr|Mrs|Dr|Ms|Prof|Dr|Miss|Mrs|Miss|Mrs|Dr|Dr|Mr|Mr|Mr|Mr|Miss|Miss|Miss|Prof|Dr|Dr|Dr|Miss|Mr|Dr|Mrs|Miss|Mr|Miss|Dr|Mr|Mrs|Mr|Prof|Ms|Mr|Miss|Mr|Mr|Mr|Mrs|Dr|Mrs|Dr|Mrs|Miss|Mr|Mr|Dr|Dr|Mrs|Mr|Mr|Mrs|Dr|Miss|Dr|Dr|Mrs|Mr|Prof|Mr|Dr|Mr|Mr|Miss|Miss|Miss|Dr|Miss|Dr|Mrs|Mr|Mr|Mr
</Title>
</Person>
</Results>
 
I want it to be be seperate <Title> element per result and not on just one element. Am I missing some configuration?
 
My result template looks like this
<#ftl encoding="utf-8" />
<#import "/web/templates/modernui/funnelback_classic.ftl" as s/>
<#import "/web/templates/modernui/funnelback.ftl" as fb/>

<#import “/web/templates/modernui/funnelback_classic.ftl” as s/>
<?xml version=“1.0” encoding=“UTF-8”?>
<Results>
<@s.Results>
<#if s.result.class.simpleName != “TierBar”>
<Person>
<#if s.result.metaData[“T”]??><Title>${s.result.metaData[“T”]!?html}</Title></#if>
</Person>
</#if>
</@s.Results>
</Results>

Would really appreciate any help on this.

 

Cheers,

Joen

 

To determine whether the issue stems from the index or the template, try looking at the native JSON output first (/s/search.json).

 

JSON responses should also show you the total number of documents indexed, and the title field for each result.

 

Based on the output you've got above, it looks like only one document is being indexed, with dozens of instances of the title field being pipe-concatenated.  Further details could be found in your collection's index.log.

 

If you can paste an example of the source XML file, it would assist in further debugging.

 

Background reading:

http://docs.funnelback.com/xml_cfg.html#Examples

To determine whether the issue stems from the index or the template, try looking at the native JSON output first (/s/search.json).

 

JSON responses should also show you the total number of documents indexed, and the title field for each result.

 

Based on the output you've got above, it looks like only one document is being indexed, with dozens of instances of the title field being pipe-concatenated.  Further details could be found in your collection's index.log.

 

If you can paste an example of the source XML file, it would assist in further debugging.

 

Background reading:

http://docs.funnelback.com/xml_cfg.html#Examples

 

 

Hi gordon,

 

Thanks for your quick reply. That's actually my intention. It's really just a single file that I want to be indexed but there will be multiple records inside that single xml file. Similar to the Example 1: Multiple records per XML file on http://docs.funnelback.com/xml_cfg.html#Examples

 

Here's the example of my single xml file, I want it to be parsed as three individual person record

<?xml version="1.0"?>
<people>
  <person>
    <staff_no>12345</staff_no>
    <title>Mr</title>
    <forename>Joe</forename>
    <surname>Bloggs</surname>
    <email_address>joe.bloggs@example.com</email_address>
  </person>
  <person>
    <staff_no>6789</staff_no>
    <title>Dr</title>
    <forename>John</forename>
    <surname>Smith</surname>
    <email_address>john.smiths@example.com</email_address>
  </person>
  <person>
    <staff_no>90123</staff_no>
    <title>Dr</title>
    <forename>Caleb</forename>
    <surname>Pascual</surname>
    <email_address>caleb.pascual@example.com</email_address>
  </person>
</people>

Thanks in advance for your help! :)

 

Regards,

Joen

Hi gordon,

 

Just an update, we did a full update using the same configuration below and it worked fine now as we wanted it to be. :) Thanks for the help

 

PADRE XML Mapping Version: 2# Define which element to split documents on
document,/people/person

Good to hear - thanks for sharing your success!