In the schema.xml, I have 3 fields - id, text and type. I set default operator to "AND"
My query is "q = (text:fire at Thai square) (type:fire)"
I tried to use edismax and set mm to 75% but It doesn't work with multiple fields.
Related
I have a table with a few key columns created with nvarchar(80) => unicode.
I can list the full dataset with SELECT * statement (Table1) and can confirm the values I need to filter are there.
However, I can't get any results from that table if I filter rows by using as input an alphabet char on any column.
Columns in table1 stores values in cyrilic characters.
I know it must have to do with character encoding => what I see in the result list is not what I use as input characters.
Unicode nvarchar type should resolve automatically this character type mismatch.
What do you suggest me to do in order to get results?
Thank you very much.
Paulo
I have a huge table in Power Query with text in cells that consist of multiple 'x's and 'z's. I want to deduplicate values so I have one x and one z only.
For example:
xzzzxxxzxz-> xz
zzzzzzzzzz-> z
The table is very big, so I don't want to create additional columns. Can you please help?
You can convert the string to a list of characters, make the list distinct (remove duplicates), sort (if desired), and then transform back to text.
= Table.TransformColumns(#"Previous Step", {{"ColumnName",
each Text.Combine( List.Sort( List.Distinct( Text.ToList(_) ) ) ),
type text}})
I would like to create a calculated dimension. How it should works is extract data from a column based on different condition, i was looking at the formulation in equivalent to the following:
In SQL:
CASE WHEN REGEXP_MATCH(Data Field A,"((?i).*PMP).*")
THEN "PMP Deal"
WHEN REGEXP_MATCH(Data Field A,"((?i).*Native Display).*")
THEN "PMP Dea"
ELSE "Non Standard Formats" END
In English:
If Data Field A contains text string PMP, please return results in column A as PMP Deal.
If Data Field A contains text string Native Display, pleas return results in column A as Native Display.
Not sure how to format the query in Lucene. The scenario is that the search term must be present in one of the two columns (either one is fine).
boolQuery.Add(query1, Occur.MUST) 'this one is fine
boolQuery.Add(query2, Occur.SHOULD)
boolQuery.Add(query3, Occur.SHOULD)
Brings up results even when the search term is not present at all in column 2 and column 3.
boolQuery.Add(query2, Occur.MUST)
boolQuery.Add(query3, Occur.SHOULD)
Does not bring up results when the search term is present in column 3 but not in column 2.
How do I format the query so that I get equivalent of this:
where column 1= val1 and (column 2 = val2 or column 3 = val2)
MUST, as the name suggests, makes the occurrence mandatory. SHOULD means optional. The first boolean query will basically match only documents hit by the first clause, but if any of them can be hit by the second or third clause, they will score higher. To get the results to match your desired linq (i assume that's what it is) statement, this should work (using java).
BooleanQuery q = new BooleanQuery();
BooleanQuery subQuery = new BooleanQuery();
subQuery.addClause(new BooleanClause(q2,Occur.SHOULD));
subQuery.addClause(new BooleanClause(q3,Occur.SHOULD));
q.addClause(new BooleanClause(q1, Occur.MUST));
q.addClause(new BooleanClause(subQuery,Occur.MUST));
Your confusion probably stems from the fact that the query API implements must and should as unary operators, while in the traditional programming languages AND and OR are binary operators
i solved a similar issue using query syntax:
+(col1:{query} OR col2:{query})
this will return the documents having the value {query} in at least one of the fields.
(note: i am using the classes Query and MultiFieldQueryParser)
I am very new to lotus notes. This will all be done on the client. I need to write a custom search that will search a particular form. This an example of the fields:
FormName = MyForm1
database fields are called Name1, Name2, Name3
datasbase fields are department1, deparment2, department3, department 4.
The search form will only have 2 fields. Name and Department. I need the following to happen, The name search field needs to seach all 3 name fields, the department field needs to search all 4 department fields.
Thank you for your assistance.
It depends a bit on exactly how fuzzy you need your search to be. Are you searching for an exact match, or for a partial match in those fields?
Assuming the exact match, you just need a formula that looks in the multiple name fields, and multiple department fields for a match. Let's call the search query fields NameQuery and DepartmentQuery. Then you could construct this formula which would return true if the value in NameQuery is found within one of the name fields, and the value in DepartmentQuery is found in one of the department fields.
#IsMember(NameQuery; Name1:Name2:Name3) & #IsMember(DepartmentQuery; Department1:Department2:Department3:Department4);
If instead you need to search for a partial match, you could use the #LIKE formula. First, concatenate the name and department field values into a single string using #IMPLODE. You can then do a wildcard match. This isn't very efficient, mind you, so if you're working on tens of thousands of documents you might want to find a better solution.
AllNameItems := #Implode(Name1:Name2:Name3; " ");
AllDepartmentItems := #Implode(Department1:Department2:Department3:Department4; " ");
#Like(AllNameItems; "%" + NameQuery + "%") & #Like(AllDepartmentItems; "%" + DepartmentQuery + "%");
Mike --
The built-in search will work fine for you, no doubt!
Here are the steps...
- Build your new form (ie, "MyForm" ) to hold your data;
- Build your view, to display your data as columns;
- Set your view's "Form Formula" to "MyForm" (with quotes)
- Make sure the "search bar", is enabled, for the view;
- Enter the values to search for;
- The results are displayed, nicely!
That should help...