solr Search by first name and last name - search

I have text field where information about user stores, including First name and last name. For example: John Bell. When I search for "John" or "Bell" or "John Bell" It works ok.
But when I search by "Bell John" - search result is 0. Is it possible to solve this issue? Schema configuration:
<field name="content" type="content_ws" indexed="true" stored="true" />
<fieldType name="content_ws" class="solr.TextField" positionIncrementGap="100">
<analyzer type="query">
<charFilter class="solr.HTMLStripCharFilterFactory"/>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
</analyzer>
<analyzer type="index">
<charFilter class="solr.HTMLStripCharFilterFactory"/>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
</analyzer>
</fieldType>

By using DisMax query parser and setting qs parameter to the value greater than 2 will help you to find query in reverse order.
Query should be something like :
http://localhost:8993/solr/select?defType=dismax&q="Bell John"&qs=2

With standard Query handler you can create queryies with the proximity parameter.
e.g. q=content:"Bell John"~2 where 2 is the slop or the number of tokens apart.
When you search for John bell the words are at position and hence a proximity slop of Zero works. There is no change in position to create the same word as being searched upon.
However, when the query is Bell John the number of hops to create the words is 2
e.g.
Bell John - Query data
Bell - One hop would bring Bell and John at the same position
John
John Bell - Second hop would recreate the indexed term.
Hence, for revered query the slop should be minimum 2 in this case.

Related

Pivot String Values in Snowflake

How can I pivot this table
ID
attribute_name
attribute_value
1
Name
John
1
Country
UK
1
City
London
into structure?
ID
Name
Country
City
1
John
UK
London
According to the documentation pivot requires a aggregate function
SELECT ...
FROM ...
PIVOT ( <aggregate_function> ( <pivot_column> )
FOR <value_column> IN ( <pivot_value_1> [ , <pivot_value_2> ... ] ) )
How can I apply this to string values?
The aggregating function can be max(). For example:
select *
from (
select xx.seq, xx.value:"#id" id, xx.value:"$" title
from BooksXML, table(flatten(xml:"$":"$")) xx
)
pivot(max(title) for id in ('bk101', 'bk102', 'bk103', 'bk104', 'bk105')) as p
order by seq
With the table:
CREATE temp TABLE BooksXML
as
select parse_xml('<catalog issue="spring">
<Books>
<book id="bk101">The Good Book</book>
<book id="bk102">The OK Book</book>
<book id="bk103">The NOT Ok Book</book>
<book id="bk104">All OK Book</book>
<book id="bk105">Every OK Book</book>
</Books>
</catalog>') xml
union all select parse_xml('
<catalog issue="spring">
<Books>
<book id="bk102">The OK Book1</book>
<book id="bk103">The NOT Ok Book1</book>
<book id="bk104">All OK Book1</book>
</Books>
</catalog>')
union all select parse_xml('
<catalog issue="spring">
<Books>
<book id="bk101">The Good Book2</book>
<book id="bk103">The NOT Ok Book2</book>
<book id="bk104">All OK Book2</book>
<book id="bk105">Every OK Book2</book>
</Books>
</catalog>');

Odoo 13 - How to Add New Column in Sales Order Lines tab

How to Add new field in Sales Order lines Tab in Odoo 13?
My Goal is to add new field/column before Product column in Sales Order Line tab.
res_sale_order_line.py
class ResSaleOrderLine(models.Model):
_inherit = "sale.order.line"
new_field = fields.Many2one('product.product', string='New Field')
views.xml
<xpath expr="//page[#name='order_lines']/field[#name='order_line']/form/group/group/field[#name='product_id']" position="before"> <field name="new_field"/> </xpath>
<xpath expr="//page[#name='order_lines']/field[#name='order_line']/tree/field[#name='product_id']" position="before"> <field name="new_field"/> </xpath>

Filter out data in XPages view

There is a Notes view(view1).The each document in the view1 have information for ID and Name.
Then, there is another view(view2) in another DB.The each document in the view2 also have information for ID and Name.
As "XPages view", I'd like to display the documents in view1 which are filtered out by view2 data.
For example,
view1 in DB1 has 4 documents.
Doc1 - ID1, AAA
Doc2 - ID2, BBB
Doc3 - ID3, CCC
Doc4 - ID4, DDD
view2 in DB2 has 2 documents.
Doc1 - ID2, BBB
Doc2 - ID3, CCC
I'd like to see the data as a XPages view which filtered out by view2 data. Is this feasible?
Doc1 - ID1, AAA
Doc2 - ID4, DDD
I feel it is possible if I'd like to get the next data by 'filter by column value'option. But I'd like to get the opposite result in XPages view.
Doc1 - ID2, BBB
Doc2 - ID3, CCC
If you retrieve a DocumentCollection for each view, you can use the following set operations on those NotesCollections: Intersect, Subtract and Merge. I think you need Subtract in your case. These operations can be very slow, in my experience.
See, e.g.: https://www.ibm.com/support/knowledgecenter/en/SSVRGU_8.5.3/com.ibm.designer.domino.main.doc/H_SUBTRACT_METHOD_COLLECTION.html
You're not filtering out documents from view 2 in results from view 1. Because they're two different databases, they're not the same document. At the very least, the UNID and NoteID will be different and as these are properties of the document, they're different documents. They just have the same values for the subset of fields you've chosen to include in your question.
You will need to extract the ViewEntries into a List of Java objects using only the values you want, then filter accordingly.
The only alternative is to write an additional property to the documents in database 1 for IsInDatabaseTwo, which you can then filter on in your view's selection formula.

Primefaces dataTable filter search By not found

I am using PrimeFaces 5.1 In my project I use dataTable and filter.In filter textbox to I enter value it will return no records found .It only show when first letter value given data to showing result (i.e) In my table name column value has Raja,Suresh,kathir. In userName column filter textbox value to First letter name r given to only shown raja result, Mid letter word of r result is not shown. When type t it result not shown.
My doubt is it text letter type starting letter based to only shown result
<p:dataTable widgetVar="userWidget"
id="userTable" value="#{ctrbean.list}" var="p" filteredValue="#{ctrbean.list}">
:column id="r" headerText="ID"
filterBy="#{p.userName}" >
<h:outputText value="#{p.userName}" />
</p:column>
</p:dataTable>
Note:I use rowkey attribute also but not working.Why it only shown based on starting letter only
add filterMatchMode="contains" to your column as shown here: http://www.primefaces.org/showcase/ui/data/datatable/filter.xhtml

SharePoint 2010 Populate Lookup Field on Activation

I have two lists: [Parents] [Children]. The Children list has a one-to-one lookup column to the Parents list. When deploying the Children List I have data written into the tag using
<Data>
<Rows>
<Row>
<Field Name="ChildName">Stephanie</Field>
<Field Name="ParentNameLookup">What value goes here?</Field>
</Row>
</Rows>
</Data>
My question: is there a way to populate the data into the tag for the ParentNameLookup field?
Try this
<Field Name="ParentNameLookup">ID;#VALUE</Field>
Where ID is ID of the Parent List Item and VALUE Represents actual Text.

Resources