I have a question on loading data into Solr using DataImportHandler.
I have a xml file which I need to load into Solr using data import handler via Xpath transformer:
XML file structure is:
<record>
<item>
<tags>
<tag1>
<tag>
<id>01</id>
<value>value01</value>
</tag>
<tag>
<id>02</id>
<value>value02</value>
</tag>
<tag1>
<tag2>
<tag>
<id>03</id>
<value>value03</value>
</tag>
<tag2>
<tag3>
<tag>
<id>04</id>
<value>value04</value>
</tag>
<tag>
<id>05</id>
<value>value05</value>
</tag>
<tag>
<id>06</id>
<value>value06</value>
</tag>
<tag3>
</tags>
</item>
</record>
I can use /record/item/tags//tag/id to load the data in a multivalue field but I need to maintain the relationship of id with value, I mean I need a way, so that at query time I can get the value related to id.
Please advice. Thanks in advance.
Related
I am having a UI page which contains a table which shows the information and we are using extjs to ftech and show the values.
My code is below.
The component looks like below:
<item name="value1" xtype="link" bind="{value}">
<position>22</position>
<default>1</default>
<displayable>1</displayable>
<enabled>1</enabled>
<exportable>1</exportable>
<alwaysAvailable>1</alwaysAvailable>
<editors>
<editor name="filter" xtype="textfield"/>
</editors>
<events>
<event name="click" jsFunction="onClickOpenScreen">
<config>{"url":"......}}</config>
</event>
</events>
<config>{"width": 100}</config>
</item>
and the model is :
<field name="value" tableAlias="table1" column="value" datatype="string">
<required>0</required>
<formula>if some value then value else 0</formula>
</field>
Here in the formula we are fetching the value from db, if value is there then value otherwise display 0.
So my requirement is if any value is there then that will come as hyperlink otherwise it will come as simple value. But from this code even 0 is coming as link.
The IBM Watson Dialog API documentation on the following page refers to an entityRules node for expert dialog designers to extract the system-programmed entities but does not say anything else about the node:
http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/doc/dialog/reference_nodes.shtml#reference_entityRules
Is there more detailed documentation on how this node can be used?
You can use entities to create your own data type. So in the doc, we see the example
<entities>
<entity name="currency" entityExample="dollar" entityType="GENERIC">
<value name="USD" value="USD">
<grammar>
<item>dollar </item>
<item>buck</item>
</grammar>
</value>
<value name="EUR" value="EUR">
<grammar>
<item>euro</item>
<item>eur</item>
<item>european buck</item>
</grammar>
</value>
<entityRules></entityRules>
</entity>
</entities>
This "currency" entity has a couple of value types (USD and EUR) but it could be extended to have more rows with more examples of each value. We could also add more values (say YEN, AUD etc or Japanese Yen, Australia Dollar etc).
The next thing would be to utilize the entity in a variation. So you could add a variation in an Input node, example:
I want to convert (currency) to (currency) tomorrow!
You can use any entities in a variation by simply including brackets around it.
You can also assign entity info into a profile variable so you can later access it and utilize it in your Dialog logic. Example variation:
I want to convert (currency)={CURRENCY1} to (currency)={CURRENCY2} tomorrow!
In this example, CURRENCY1 and CURRENCY2 are profile variables, that at run time, contain the entity match info.
Hope this helps.
I am trying to update shipping information through the feed API and here is my xml feed
<?xml version="1.0" encoding="UTF-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>Merchant id</MerchantIdentifier>
</Header>
<MessageType>OrderFulfillment</MessageType>
<Message>
<MessageID>1</MessageID>
<OrderFulfillment>
<MerchantOrderID>AmazonOrderId</MerchantOrderID>
<FulfillmentDate>2015-05-23T04:57:09+00:00</FulfillmentDate>
<FulfillmentData>
<CarrierCode>Fedex</CarrierCode>
<ShipperTrackingNumber>78066505</ShipperTrackingNumber>
</FulfillmentData>
<Item>
<MerchantOrderItemID>OrderItemId</MerchantOrderItemID>
</Item>
</OrderFulfillment>
</Message>
</AmazonEnvelope>
When I submit the feed getting response as We are unable to process the XML feed because one or more items are invalid. Please re-submit the feed. But both the order id and order item id is valid one.
In the sample feed provided by amazon I can see <MerchantFulfillmentID>1234567</MerchantFulfillmentID> and <MerchantFulfillmentItemID>1234567</MerchantFulfillmentItemID> but where can I find these ids.
As stated here Selling on Amazon Guide to XML:
You can send your own unique order and item identifiers
(MerchantOrderID and MerchantOrderItemID) rather than Amazon's order
and item identifiers, if you established your own in the
OrderAcknowledgement feed.
MerchantOrderID:
Optional seller supplied order ID. The first step is to establish the
MerchantOrderID in the acknowledgem ent feed. Amazon will map the
MerchantOrderID to the AmazonOrderID, and you can then use your own
order ID (MerchantOrderID) for subsequent feeds relating to that
order. See the base XSD for the definition.
MerchantFulfillmentID:
Seller supplied unique identifier for the shipment (not used by Amazon)
If you did not established your own ID´s in the OrderAcknowledgement feed, you can not use this fields in the Order Fulfillment feed.
Instead you have to speficy AmazonOrderID and Item.AmazonOrderItemCode. The AmazonOrderItemCode is an code for this specific product in this specific order. It has nothing todo with the famous ASIN or something.
Working example for an _POST_ORDER_FULFILLMENT_DATA_ feed would like like:
<AmazonEnvelope>
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>M_TESTSHOP_1337</MerchantIdentifier>
</Header>
<MessageType>OrderFulfillment</MessageType>
<Message>
<MessageID>1</MessageID>
<OrderFulfillment>
<AmazonOrderID>110-64133780-1337563</AmazonOrderID>
<FulfillmentDate>2015-11-02T13:02:14</FulfillmentDate>
<FulfillmentData>
<CarrierName>DHL</CarrierName>
<ShippingMethod>Paket</ShippingMethod>
<ShipperTrackingNumber>1337</ShipperTrackingNumber>
</FulfillmentData>
<Item>
<AmazonOrderItemCode>033521337643</AmazonOrderItemCode>
<Quantity>1</Quantity>
</Item>
</OrderFulfillment>
</Message>
</AmazonEnvelope>
my company uses an external company to provide their search needs (SLI) I have implemented Solr instead as it is free and frankly superior. However SLI provide a feature where if you search for special keywords like "help" or "contact" the response from SLI will not include the content and instead only a few nodes similar to
<response>
<merch><jumpurl>http://somedomain.com/somejumpurl</jumpurl></merch>
</response>
Any ideas how I can provide this feature with Solr?
What you are looking for is then a type of "sponsored search".
Something similar to that in Solr can be achieved with the QueryElevationComponent.
You need to configure it in your solrconfig.xml, then make a dedicated field to use it and then create an external xml file with your special words and rules you want to apply, for example:
<elevate>
<query text="AAA">
<doc id="A" />
<doc id="B" />
</query>
<query text="ipod">
<doc id="A" />
<!-- you can optionally exclude documents from a query result -->
<doc id="B" exclude="true" />
</query>
</elevate>
And then use it in this way:
http://host/solr/elevate?q=YYYY&debugQuery=true&enableElevation=true
If you want to return only the results specified in the elevation file, add exclusive=true to the URL:
http://host/solr/elevate?q=YYYY&debugQuery=true&exclusive=true
The XML has some descriptive fields and I would like to use them to select specific fields. Is there a way to get the data import handler to pick only "Text Block A" and "Text Block B" using "code=34089-3" as a key? The code field has no data but it is unique to the type of information I want to pick. When I use xpath="/document/component/section/text/paragraph" I end up with text blocks A, B, C and D. Ideally I would like to be able to pick only text block A. Is this even possible?
<component>
<section>
<id root="f915965e-fe3b-44eb-a2ed-c11f807e7f23"/>
<code code="34089-3"/>
<title>Title A</title>
<text>
<paragraph>Text Block A</paragraph>
<paragraph>Text Block B</paragraph>
</text>
</section>
</component>
<component>
<section>
<id root="80b7e2f1-f49f-4309-a340-210536705d4a"/>
<code code="34090-1"/>
<title>Title B</title>
<text>
<paragraph>Text Block C</paragraph>
<paragraph>Text Block D</paragraph>
</text>
</section>
</component>
<entity
name="IUPAC"
processor="XPathEntityProcessor"
forEach="/document"
url="${f.fileAbsolutePath}">
<field column="chemical_name" xpath="/document/component/section/code[#code='34089-3']/access below values???" />
</entity>
Try something like that:
/document/component/section[code/#code='34089-3']/text/paragraph