Searching exact match.
Hello all,
How to perform exact match using CONTAINS?
For Eg. to fetch all rows having some exact text like "2003 and 2006" how to do with Contains? I know we can do this with Like operator (Like '%2003 and 2006%') but how to do it with Contains operator?
I tried
1. Contains(field, '{2003 and 2006}',1)>0
2. Contains(field, '"2003 and 2006"',1)>0
3. Contains(field, '%2003 and 2006%',1)>0
Nothing worked. BTW i am using 10g.
Thanks
If you do not specify a stoplist, then Oracle uses the default stoplist. You can specify empty_stoplist when creating your index or provide your own stoplist. You can find the stopwords by selecting from ctx_stopwords. The stopwords are also listed in the online documentaiton. The example below uses an empty stoplist.
SCOTT@orcl_11g> CREATE TABLE your_table
2 (field VARCHAR2 (60))
3 /
Table created.
SCOTT@orcl_11g> begin
2 insert INTO your_table VALUES ('again the');
3 insert INTO your_table VALUES ('again and the');
4 insert INTO your_table VALUES ('again');
5 insert INTO your_table VALUES ('again something here the');
6 end;
7 /
PL/SQL procedure successfully completed.
SCOTT@orcl_11g> CREATE INDEX your_index ON your_table (field)
2 INDEXTYPE IS CTXSYS.CONTEXT
3 parameters
4 ('sync (on commit)
5 stoplist ctxsys.empty_stoplist')
6 /
Index created.
SCOTT@orcl_11g> SELECT * FROM your_table
2 WHERE CONTAINS (field, '{again and the}', 1) > 0
3 /
FIELD
again and the
SCOTT@orcl_11g>
Similar Messages
-
Hi,
I have one requirement where user want to returns extact match unless user explicitly specify % in the search column;
For Ex: Lets say user enter 24 it should return any records that matches exact value. Currently it returns all the value starting with 24 in simple search.
I understand that we can use different operators in Advance Search.
I tried to dynamically add where clauss in CO but I am getting lots of error arround bind variables.
Please advice.
Thanks,
MaheshAny input value in the LOV field will go for partial match.
--Shiv -
Search MS Word for Exact Match
I've got a script that opens an MS Word document, then searches through a directory for each image file (.jpg), then does a find and replace using the filename as the search string, and inserts the image in place of the text it finds. My problem is that
it's not doing an exact match. This means for example that if it looks for image1.jpg and that text exists in the word document inserts the image in it's place (the text being a placeholder). But if mimimage1.jpg was in place before it then it would insert
the .jpg there - not doing an exact match.
Here's the code I've got so far:
# Get variables from XML file
$MyDir = Split-Path $MyInvocation.MyCommand.Definition
# Get settings from variables.xml.
[xml]$settings = get-content "$MyDir\variables-test.xml"
# Assign the settings to local variables.
$SMTP = $settings.Settings.Setting.SMTP
$port = $settings.Settings.Setting.port
$from = $settings.Settings.Setting.EmailFrom
$to = $settings.Settings.Setting.EmailTo
$subject = $settings.Settings.Setting.Subject
$body = $settings.Settings.Setting.Body
$savepath = $settings.Settings.Setting.SavePath
$docfile = $settings.Settings.Setting.WordDoc
$XMLpath = "$MyDir\variables.xml"
[String[]]$strXML=@()
[xml]$xml = get-content $XMLpath
$parse_results = New-Object System.Collections.ArrayList
add-type -AssemblyName "Microsoft.Office.Interop.Word"
$wdunits = "Microsoft.Office.Interop.Word.wdunits" -as [type]
$application = New-Object -comobject word.application
$application.visible = $false
$document = $application.documents.open($docfile)
set-variable -name wdGoToLine -value 3 -option constant
set-variable -name wdGoToAbsolute -value 1 -option constant
# Create new directory
$date = (Get-Date -format "dd-MM-yyyy")
$newdir = $savepath + "archive" + "-" + $date
New-Item -ItemType directory -Path $newdir
# Search Word document for filename and insert image
foreach($file in Get-ChildItem $savepath -Filter *.jpg)
if ($application.Selection.Find.Text = $file)
if ($application.Selection.Find.Execute())
$insertfile = $savepath + $file
$objSelection = $application.selection
$objShape = $objSelection.InlineShapes.AddPicture($insertfile)
$gotoline = $objSelection.GoTo($wdGoToLine, $wdGoToAbsolute,1)
# Move spreadsheets and images to archive location and cleanup after dfm2xls.ps1 before ending script
foreach($movexlsx in Get-ChildItem $savepath -Filter *.xlsx)
$xlpath = $savepath + $movexlsx
Move-Item $xlpath $newdir
foreach($movejpg in Get-ChildItem $savepath -Filter *.jpg)
$imgpath = $savepath + $movejpg
Move-Item $imgpath $newdir
# Save document then close application
$newsave = $savepath + $date + "-report.docx"
$document.SaveAs([ref]$newsave)
$document.Close()
$application.quit()
At the moment it doesn't do an exact match but I've tried using:
$MatchWholeWord = $True
$MatchCase = $False
and then
$application.Selection.Find.Execute($MatchWholeWord, $MatchCase)
But that stopped it from finding any matches. Can anyone help?
Thanks in advanceHi AJ Mellor,
If you want to replace the words of the .jpg file's name with the picture in word file, this script should be helpful for you to modify your script:
Hey, Scripting Guy! How Can I Read Words in a Text File and Make Those Same Word Italic in a Word Document?
Insert pictures in a folder into a Word document (PowerShell)
In addition, to get the words of the file name instead of the full path name, please refer to the script below:
$files = Get-ChildItem $savepath -Filter *.jpg
$words = $files.basename
foreach($word in $words){
I hope this helps. -
Search for calendars with exact match
Hello,
I am work on customisation of uwc. I have problem with calendar search. I am getting the result of substring matches. I want to have exact matches. I suppose that it is some kind of configuration of Sun Calendar Server. Could you give me please some advices?
Thank youHi,
jslezak wrote:
I am work on customisation of uwc. I have problem with calendar search. I am getting the result of substring matches. I want to have exact matches. I suppose that it is some kind of configuration of Sun Calendar Server. Could you give me please some advices?Which screen are you talking about precisely? Is this the calendar subscription search screen or the attendee search screen?
A number of the searches are controlled by the calendar ics.conf file. So try matching the directory access entry which relates to your search to the appropriate string in ics.conf and that should provide a guide as to what needs to be changed.
Regards,
Shane. -
How to execute exact match & contains text search simultaneoulsy in Oracle 10g
Hi,
We have scenario where there are more than 50 million rows in a table with description column length as 1000 character. We have a web interface from where we generate a rule of comma separated keywords like
"Standard", Single, Cancel, "deal" & so on. The words in quotes needs to be checked for exact match & the one without quotes will be searched using contains.
The problem is that we can have a rule of such a combination as large as 4000 characters of inclusion & 2000 such characters for exclusion (not to consider the description under exclusion) and this search when run on the table with millions of rows does not work using oracle regular expression, but works with smaller no. of search keywords.
Is there a better way to do such a kind of search in Oracle or if not then outside oracle using any other tool
Thanks,
APPlease find below the table script, few insert statements along with the SP & function. Please help.
-- Create Table
CREATE TABLE Roomdescriptionmaster
ID long,
ROOMDESCRIPTION nvarchar2, --- max 1000 charaters
Createddate datetime
----- Insert statements
INSERT INTO ROOMDESCRIPTION (ID, ROOMDESCRIPTION, Createddate ) VALUES (1, 'Double Room (2 Adults + 2 Children) | FREE cancellation before Mar 16, 2014 PAY LATER All-Inclusive [ Included:10 % VAT] Meals:All meals and select beverages are included in the room rate.Cancellation:If canceled or modified up to 2 days before date of arrival,no fee will be charged.If canceled or modified later,100 percent of the first two nights will be charged.In case of no-show, the total price of the reservation will be charged. Prepayment:No deposit will be charged', sysdate)
INSERT INTO ROOMDESCRIPTION (ID, ROOMDESCRIPTION, Createddate ) VALUES (1, 'Double or Twin Room | FREE cancellation before Feb 1, 2014 PAY LATER All-Inclusive [ Included:10 % VAT] Meals:All meals and select beverages are included in the room rate.Cancellation:If canceled or modified up to 2 days before date of arrival,no fee will be charged.If canceled or modified later,100 percent of the first two nights will be charged.In case of no-show, the total price of the reservation will be charged. Prepayment:No deposit will be charged', sysdate)
INSERT INTO ROOMDESCRIPTION (ID, ROOMDESCRIPTION, Createddate ) VALUES (1, 'Quadruple Room (3 Adults + 1 Child) | FREE cancellation before Mar 16, 2014 PAY LATER Full board included [ Included:10 % VAT] Meals:Breakfast, lunch & dinner included.Cancellation:If canceled or modified up to 2 days before date of arrival,no fee will be charged.If canceled or modified later,100 percent of the first two nights will be charged.In case of no-show, the total price of the reservation will be charged. Prepayment:No deposit will be charged', sysdate)
INSERT INTO ROOMDESCRIPTION (ID, ROOMDESCRIPTION, Createddate ) VALUES (1, 'Triple Room with Lateral Sea View (2 Adults + 1 Child) | FREE cancellation before Dec 6, 2013 PAY LATER All-Inclusive [ Included:10 % VAT] Meals:All meals and select beverages are included in the room rate.Cancellation:If canceled or modified up to 2 days before date of arrival,no fee will be charged.If canceled or modified later,100 percent of the first two nights will be charged.In case of no-show, the total price of the reservation will be charged. Prepayment:No deposit will be charged', sysdate)
INSERT INTO ROOMDESCRIPTION (ID, ROOMDESCRIPTION, Createddate ) VALUES (1, 'Single Room with Lateral Sea View | FREE cancellation before Dec 6, 2013 PAY LATER All-Inclusive [ Included:10 % VAT] Meals:All meals and select beverages are included in the room rate.Cancellation:If canceled or modified up to 2 days before date of arrival,no fee will be charged.If canceled or modified later,100 percent of the first two nights will be charged.In case of no-show, the total price of the reservation will be charged. Prepayment:No deposit will be charged', sysdate)
--SP
CREATE OR REPLACE PROCEDURE
SP_PGHGETROOMDESCRIPTION(v_BId number,
v_DaysOfData integer,
v_Incl1 nvarchar2,
v_Incl2 nvarchar2,
v_Incl3 nvarchar2,
v_Excl1 nvarchar2,
v_CurrentIndex integer,
v_RecordPerPage integer,
v_IndexMultiplier integer,
ref_recordset out sys_refcursor
) as
start_index integer;
end_index integer;
Incl1 nvarchar2(2000);
Incl2 nvarchar2(2000);
Incl3 nvarchar2(2000);
Excl1 nvarchar2(2000);
v_desc_utf_value VARCHAR2(10);
begin
v_desc_utf_value:= 'utf8';
if v_incl1 is null or trim(v_incl1) = '' then
--dbms_output.put_line('include 1 is null or blank');
Incl1 := '';
else
Incl1 := lower(v_Incl1);
end if;
if v_incl2 is null or trim(v_incl2) = '' then
--dbms_output.put_line('include 2 is null or blank');
Incl2 := '';
else
Incl2 := lower(v_Incl2);
end if;
if v_incl3 is null or trim(v_incl3) = '' then
--dbms_output.put_line('include 3 is null or blank');
Incl3 := '';
else
Incl3 := lower(v_Incl3);
end if;
if v_Excl1 is null or trim(v_Excl1) = '' then
--dbms_output.put_line('Exclude 1 is null or blank');
Excl1 := '';
else
Excl1 := lower(v_Excl1);
end if;
-- Old code
-- and regexp_like(lower(ROOMDESCRIPTION), Incl1, 'i')
-- and regexp_like(lower(ROOMDESCRIPTION), Incl2, 'i')
-- and regexp_like(lower(ROOMDESCRIPTION), Incl3, 'i')
-- and not regexp_like(lower(ROOMDESCRIPTION), Excl1, 'i')
--- First call to SP
if v_CurrentIndex = 1 then
start_index := v_RecordPerPage * v_IndexMultiplier;
end_index := (v_CurrentIndex - 1 + v_IndexMultiplier) * v_RecordPerPage;
open ref_recordset for
select * from (
select ROOMDESCRIPTION, Createddate, rownum as rn
from roomdescriptionmaster
where BID = v_BId
and TO_NUMBER(trunc(sysdate) - to_date(to_char(createddate, 'yyyy-mm-dd'),'yyyy-mm-dd')) <= v_DaysOfData
and length(FN_GET_RESTRICTION(lower(ROOMDESCRIPTION),Incl1,Incl2,Incl3,Excl1,v_desc_utf_value)) > 0
and row_num <= v_RecordPerPage * v_IndexMultiplier
order by row_num;
else
--- Subsequent calls to SP using paging from UI
start_index := (v_CurrentIndex - 1) * v_RecordPerPage + 1;
end_index := (v_CurrentIndex - 1 + v_IndexMultiplier) * v_RecordPerPage;
open ref_recordset for
select * from (
select ROOMDESCRIPTION, Createddate, rownum as rn
from roomdescriptionmaster
where BID = v_BId
and TO_NUMBER(trunc(sysdate) - to_date(to_char(createddate, 'yyyy-mm-dd'),'yyyy-mm-dd')) <= v_DaysOfData
and length(FN_GET_RESTRICTION(lower(ROOMDESCRIPTION),Incl1,Incl2,Incl3,Excl1,v_desc_utf_value)) > 0
order by roomdescriptionmasterid desc
where rn >= start_index
and rn <= end_index
order by rn;
end if;
commit;
end SP_PGHGETROOMDESCRIPTION;
--Function
CREATE OR REPLACE FUNCTION FN_GET_RESTRICTION(
v_rate_description IN NVARCHAR2,
v_include_1 IN NVARCHAR2,
v_include_2 IN NVARCHAR2,
v_include_3 IN NVARCHAR2,
v_exclude IN NVARCHAR2, v_desc_utf_value IN VARCHAR2)
RETURN NVARCHAR2
IS
CURSOR include_1_cur IS
select regexp_substr(str, '[^,]+', 1, level) str
from (select v_include_1 str from dual)
connect by level <= length(str)-length(replace(str,','))+1;
CURSOR include_2_cur IS
select regexp_substr(str, '[^,]+', 1, level) str
from (select v_include_2 str from dual)
connect by level <= length(str)-length(replace(str,','))+1;
CURSOR include_3_cur IS
select regexp_substr(str, '[^,]+', 1, level) str
from (select v_include_3 str from dual)
connect by level <= length(str)-length(replace(str,','))+1;
CURSOR exclude_cur IS
select regexp_substr(str, '[^,]+', 1, level) str
from (select v_exclude str from dual)
connect by level <= length(str)-length(replace(str,','))+1;
include_1_rec include_1_cur%rowtype;
include_2_rec include_2_cur%rowtype;
include_3_rec include_3_cur%rowtype;
exclude_rec exclude_cur%rowtype;
tmp_var NVARCHAR2(200);
tmp_var_int NUMBER;
tmp_flag_int NUMBER;
return_str NVARCHAR2(200);
tmp_length NUMBER;
tmp_length_include_1 NUMBER;
tmp_length_include_2 NUMBER;
tmp_length_include_3 NUMBER;
tmp_length_exclude NUMBER;
tmp_regex_pattern VARCHAR2(1000);
flag_include_1_match INTEGER;
flag_include_2_match INTEGER;
flag_include_3_match INTEGER;
flag_exclude_match INTEGER;
BEGIN
tmp_length_include_1 := nvl(length(v_include_1),0);
tmp_length_include_2 := nvl(length(v_include_2),0);
tmp_length_include_3 := nvl(length(v_include_3),0);
tmp_length_exclude := nvl(length(v_exclude),0);
flag_include_1_match := 0;
flag_include_2_match := 0;
flag_include_3_match := 0;
flag_exclude_match := 0;
IF tmp_length_include_1>0 OR tmp_length_include_2 >0
OR tmp_length_include_3 >0 OR tmp_length_exclude >0 THEN
IF v_desc_utf_value ='utf8' THEN
----------------------------------------------------- UTF 8 STARTED --------------
----------------------------------------- INCLUDE 1
tmp_length := tmp_length_include_1;
IF tmp_length > 0 THEN
tmp_flag_int :=0;
FOR include_1_rec in include_1_cur
LOOP
tmp_var := trim('' || include_1_rec.str);
--dbms_output.put_line(tmp_var);
tmp_regex_pattern := '[^[:alnum:]]'||tmp_var||'[^[:alnum:]]|^'||tmp_var||'$|^'||tmp_var||'[^[:alnum:]]|[^[:alnum:]]'||tmp_var||'$';
tmp_var_int := nvl(regexp_instr(v_rate_description,tmp_regex_pattern,1,1),0);
IF (tmp_var_int <> 0) THEN
tmp_flag_int :=1;
flag_include_1_match := 1;
EXIT;
END IF;
END LOOP;
ELSE
flag_include_1_match := 1;
END IF;
-------------------------------------------- INCLUDE 2
tmp_length := tmp_length_include_2;
IF tmp_length > 0 THEN
tmp_flag_int :=0;
IF flag_include_1_match =1 THEN
FOR include_2_rec in include_2_cur
LOOP
tmp_var := trim('' || include_2_rec.str);
tmp_regex_pattern := '[^[:alnum:]]'||tmp_var||'[^[:alnum:]]|^'||tmp_var||'$|^'||tmp_var||'[^[:alnum:]]|[^[:alnum:]]'||tmp_var||'$';
tmp_var_int := nvl(regexp_instr(v_rate_description,tmp_regex_pattern,1,1),0);
IF (tmp_var_int <> 0) THEN
tmp_flag_int :=1;
flag_include_2_match := 1;
EXIT;
END IF;
END LOOP;
END IF;
ELSE
flag_include_2_match := 1;
END IF;
-------------------------------------------- INCLUDE 3
tmp_length := tmp_length_include_3;
IF tmp_length > 0 THEN
tmp_flag_int :=0;
IF flag_include_2_match =1 THEN
FOR include_3_rec in include_3_cur
LOOP
tmp_var := trim('' || include_3_rec.str);
tmp_regex_pattern := '[^[:alnum:]]'||tmp_var||'[^[:alnum:]]|^'||tmp_var||'$|^'||tmp_var||'[^[:alnum:]]|[^[:alnum:]]'||tmp_var||'$';
tmp_var_int := nvl(regexp_instr(v_rate_description,tmp_regex_pattern,1,1),0);
IF (tmp_var_int <> 0) THEN
tmp_flag_int :=1;
flag_include_3_match := 1;
EXIT;
END IF;
END LOOP;
END IF;
ELSE
flag_include_3_match := 1;
END IF;
-------------------------------------------- EXCLUDE
tmp_length := tmp_length_exclude;
IF tmp_length > 0 and flag_include_3_match =1 THEN
FOR exclude_rec in exclude_cur
LOOP
tmp_var := trim('' || exclude_rec.str);
tmp_regex_pattern := '[^[:alnum:]]'||tmp_var||'[^[:alnum:]]|^'||tmp_var||'$|^'||tmp_var||'[^[:alnum:]]|[^[:alnum:]]'||tmp_var||'$';
tmp_var_int := nvl(regexp_instr(v_rate_description,tmp_regex_pattern,1,1),0);
IF (tmp_var_int <> 0) THEN
tmp_flag_int := -1;
return_str := '';
EXIT;
END IF;
END LOOP;
END IF;
ELSE
----------------------------------------------------- UTF 16 STARTED --------------
----------------------------------------- INCLUDE 1
tmp_length := tmp_length_include_1;
IF tmp_length > 0 THEN
tmp_flag_int :=0;
FOR include_1_rec in include_1_cur
LOOP
tmp_var := trim('' || include_1_rec.str);
--dbms_output.put_line(tmp_var);
tmp_var_int := nvl(INSTR(v_rate_description,tmp_var,1,1),0);
IF (tmp_var_int <> 0) THEN
tmp_flag_int :=1;
flag_include_1_match := 1;
EXIT;
END IF;
END LOOP;
ELSE
flag_include_1_match := 1;
END IF;
-------------------------------------------- INCLUDE 2
tmp_length := tmp_length_include_2;
IF tmp_length > 0 THEN
tmp_flag_int :=0;
IF flag_include_1_match =1 THEN
FOR include_2_rec in include_2_cur
LOOP
tmp_var := trim('' || include_2_rec.str);
tmp_var_int := nvl(INSTR(v_rate_description,tmp_var,1,1),0);
IF (tmp_var_int <> 0) THEN
tmp_flag_int :=1;
flag_include_2_match := 1;
EXIT;
END IF;
END LOOP;
END IF;
ELSE
flag_include_2_match := 1;
END IF;
-------------------------------------------- INCLUDE 3
tmp_length := tmp_length_include_3;
IF tmp_length > 0 THEN
tmp_flag_int :=0;
IF flag_include_2_match =1 THEN
FOR include_3_rec in include_3_cur
LOOP
tmp_var := trim('' || include_3_rec.str);
tmp_var_int := nvl(INSTR(v_rate_description,tmp_var,1,1),0);
IF (tmp_var_int <> 0) THEN
tmp_flag_int :=1;
flag_include_3_match := 1;
EXIT;
END IF;
END LOOP;
END IF;
ELSE
flag_include_3_match := 1;
END IF;
-------------------------------------------- EXCLUDE
tmp_length := tmp_length_exclude;
IF tmp_length > 0 and flag_include_3_match =1 THEN
FOR exclude_rec in exclude_cur
LOOP
tmp_var := trim('' || exclude_rec.str);
tmp_var_int := nvl(INSTR(v_rate_description,tmp_var,1,1),0);
IF (tmp_var_int <> 0) THEN
tmp_flag_int := -1;
return_str := '';
EXIT;
END IF;
END LOOP;
END IF;
END IF;
IF tmp_flag_int = 1 THEN
return_str := 'truely matched';
ELSE
return_str := '';
END IF;
ELSE
return_str := '';
END IF;
return return_str;
EXCEPTION
WHEN OTHERS THEN
--dbms_output.put_line('Exception');
RAISE;
END FN_GET_RESTRICTION; -
ITunes 10 search for exact match or Boolean Searches
Is there a way to force an exact match when performing a search in iTunes?
I tried putting "" around my search and get no results.
The goal would be to search Artists for the artist "Hem", and only show results for only "Hem" and not both "Hem" and "Edie Brickel and the New Bohemians"
As far as I can tell there are no Boolean search options in here either.
iTunes 10.1 (54)Mad.Macs wrote:
Thanks,
I know Smart Playlists is a workaround for this, but that is about that is about 6 clicks plus typing to accomplish what could be done by simply typing in "hem" in the search field. If you use Smart Playlists for this, you would also need to go back and delete the playlist when you are done.
Yep, like I said I leave it there for next time....
I wonder why they would leave what is now a universally understood search option out of iTunes?
Who knows? Feature requests go to iTunes Feedback.
tt2 -
Hi,
Can anyone please help me in creating the Custom Search box with below mentioned functionality
"The search box will allow up to 60 alphanumeric characters.User can input a minimum of 1 character and the system will pull back an exact match on the sequence entered"Hi Pradeep,
Find the complete JQuery AutoComplete function with along with different events in it like focus, select, open and close. You can modify this code as per your requirement.
$("#ddlSearchTextBox").autocomplete({
source: function (request, response) {
var getUrl = "<site URL>";
$.ajax({
url: getUrl,
type: "GET",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: {
featureClass: "P",
style: "full",
maxRows: 10
dataFilter: function (data, type) {
return data.replace(/\\'/g, "'");
success: function (data) {
response($.map(data.d, function (result) {
return {
label: result.Last_Name + ", " + result.First_Name,
value: result.id
focus: function (event, ui) {
$("#ddlSearchTextBox").val(ui.item.label);
return false;
minLength: 1,
select: function (event, ui) {
$("#ddlSearchTextBox").val(ui.item.label);
return false;
open: function () {
$("#ddlSearchTextBox").removeClass("ui-corner-all").addClass("ui-corner-top");
close: function () {
$("#ddlSearchTextBox").removeClass("ui-corner-top").addClass("ui-corner-all");
Let us know if you need any further.
Thanks, Shakir | Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply. -
Is there a way to promote results with exact match?
Hi,
Is there a way to promote (like add results block or something) results with exact match over results that match?
(when stemming is on, so the search consider also words with morpholgy match, and sometimes display them at the top, and wWe want to put in top of the results a block of results with exact match)
keren tsurHI,
Yes you can promote the result with exact match.....
1. Navigate to the search center
2. Navigate to the search result setting page and click to the Query rule as per your scope.
3. Create the new query rule depend upon your result source.
4. Give the query rule name. Under the Query Condition-> select "Advanced Query Text Match"-> Select Option that you want form matches input->Make the Check box "Entire Query Matches Exactly".
5. Create the promoted results and Result block as per your description.
6. save the Query rule and apply the query rule to your search vertical.
Regards,
sharepoint for developer
Basant Pandey -
I am wanting to exactly match two ID numbers from two worksheets within the one work book. ID numbers are non linear. Once exactly matched I wish to retrieve a corresponding row value from worksheet two and have it appear in worksheet one against the correct ID number. I have been looking at IF, VLOOKUP, and MATCH functions and suspect that what I want to do requires a combination of two or more. Any help will be greatly appreciated.
regards VaughanhVaughan,
Data A:D is all cells start at column A thru column D.
There is built-in help using the menu item "View > Show Function Browser" in the search field (top right) you can enter vlookup and you will see the detailed description.
From this we see:
VLOOKUP
(search-for, columns-range, return-column, close-match)
search-for: The value to find. search-value can contain any value type.
columns-range: A range of cells. range is a reference to a single range of cells, which may contain values of any type.
return-column: A number that specifies the relative column number of the cell from which to return the value. return-column is a number value. The leftmost column in the range is column 1.
close-match: An optional value that determines whether an exact match is required.
close match (TRUE, 1, or omitted): If there’s no exact match, select the column with the largest top-row value that is less than the search value. Wildcards can’t be used in search-for.
exact match (FALSE or 0): If there’s no exact match, return an error. Wildcards can be used in search-for.
So... the 2,0 means return the value form the same row as the lookup value but from the 2nd column of the range. 3, 0 means from the 3rd column. the ", 0" means exact match -
MySql database query (exact match from a list)
I've got a list of keywords entered into a database field
called
'tour_keywords' like:
europe, austria, lakes, mountains, tyrol, alpine etc
What I want is for results to be return IF ONLY an exact
match is found
in the database. The way I have it at the moment (see mySql
query below)
I only need to type 'tain' or 'kes' and I get results for
'moun'tain's'
OR 'la'kes'' :(
Can I stop this and match only the keywords as specified in
the database
field.
This is the DB query I have:
$query_rsResultsList = sprintf("SELECT * FROM tours WHERE
tour_keywords
LIKE '%%%s%%' ", $colname_rsResultsList);
Thanks
Os.Michael Fesser wrote:
> .oO(Osgood)
>
>
>>I've got a list of keywords entered into a database
field called
>>'tour_keywords' like:
>>
>>europe, austria, lakes, mountains, tyrol, alpine etc
>
>
> Uh ...
>>What I want is for results to be return IF ONLY an
exact match is found
>>in the database. The way I have it at the moment (see
mySql query below)
>>I only need to type 'tain' or 'kes' and I get results
for 'moun'tain's'
>>OR 'la'kes'' :(
>
>
> What about a different table design?
Yeah nice thought. I only have a little to no knowledge of
working with
one table, let alone two or three.
Your current approach is not only
> bad in terms of normalization, it's also very
inefficient, since the DB
> can't use any indexes when performing a search. Full
table scans are
> expensive.
Humm why can't mySql just search a field containing multiple
words for a
particular matching word with a simple query.....maybe that's
what's
inefficient. Granted, I'm totally inefficient as well
(unfortunately I
was born that way) but two inefficients dont make an
efficient ;)
> Since this is a typical m:n relation (many to many), I
would use three
> tables: one for the main tour data, one for the keywords
and a third one
> to connect these:
>
> tours
> -----
> tourId INT UNSIGNED
> ...
> PRIMARY KEY (tourId)
>
> keywords
> --------
> keywordId INT UNSIGNED
> keyword CHAR(20)
> PRINARY KEY (keywordId)
>
> tourKeywords
> ------------
> tourId INT UNSIGNED (FOREIGN KEY on tours.tourId)
> keywordId INT UNSIGNED (FOREIGN KEY on
keywords.keywordId)
> PRIMARY KEY (tourId, keywordId)
>
> This makes it very easy to insert new keywords and to
assign as many
> keywords as necessary to a particular tour. In addition
searching for
> all tours matching one or even multiple(!) keywords is
very efficient.
> Try that with your current design.
Here's wishing lol.
>>Can I stop this and match only the keywords as
specified in the database
>>field.
>>
>>This is the DB query I have:
>>
>>$query_rsResultsList = sprintf("SELECT * FROM tours
WHERE tour_keywords
>>LIKE '%%%s%%' ", $colname_rsResultsList);
>
>
> In the example above the search query would look like
>
> SELECT ...
> FROM tours t
> INNER JOIN tourKeywords USING(tourId)
> INNER JOIN keywords USING(keywordId)
> WHERE keyword = 'mountains'
>
> or for multiple keywords:
>
> ...
> WHERE keyword IN ('mountains', 'lakes')
> GROUP BY t.tourId
Damn.... stop messing with my head.
I'm sure youre 100% correct but I'm a long way off the pace
when it
comes to database structure. -
Finding exact matches using WITHIN clause or?
We are storing documents in XML format in a CLOB. We need to find exact matches within an element through intermedia. Is there a way we can use the WITHIN clause or a different type of clause to get only exact matches for a phrase?
e.g., a search on 'accord' would not bring back 'peace accord' etc.Hi,
I recommend asking your question in an Excel forum:
http://social.technet.microsoft.com/Forums/en-us/home?forum=excel&filter=alltypes&sort=lastpostdesc
There's an Excel forum over on the MSDN side as well, but it focuses more on VBA:
http://social.msdn.microsoft.com/Forums/en-us/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
This is a PowerShell forum.
Don't retire TechNet! -
(Don't give up yet - 12,950+ strong and growing) -
Query to display the exact match product at top or increase the nearness
Hello All,
I am using the iStore search and it is returning results for Part Number and Description search. If I am searching a particular Part Number , it is displaying the particular product and its related products. I need the exact matched product in the first row (topmost).
When I checked the back-end query, It is using contains for powerful search.
How can I display the exact match product at top or increase the nearness in search.
Please help.
I have seen a similar thread in the forum.
Contains: exactly match
Thanks in advance,
Muhammed Aslam
Edited by: tpmuhammedaslam on Jan 10, 2013 3:48 AMHello Muhammed Aslam,
If fuzzy search is enabled, then cannot search by part number.
The seeded query for iStore product search is based on the description as follows:
Product Search (Section Search - R12)
select * from
(select T.*, RowNum as row_num
from (select inv_item_id INVENTORY_ITEM_ID
,description DESCRIPTION
,0 CATEGORY_ID
,nearness NEARNESS
,concatenated_segments CONCATENATED_SEGMENTS
,primary_uom_code PRIMARY_UOM_CODE
,primary_unit_of_measure PRIMARY_UNIT_OF_MEASURE
from (SELECT * FROM (select /*+ FIRST_ROWS leading(i) INDEX (x,IBE_SECTION_SEARCH_U1) */
distinct i.inventory_item_id, i.description, 0
,x.inventory_item_id inv_item_id, score(100) nearness
,mtl_system_items_b_kfv.concatenated_segments,
mtl_system_items_b_kfv.primary_uom_code,
mtl_system_items_b_kfv.primary_unit_of_measure
from ibe_ct_imedia_search i,ibe_section_search x
,mtl_system_items_b_kfv
where contains (i.indexed_search, :1 , 100) > 0
and i.language = userenv('LANG')
and i.organization_id = :2
and i.web_status='PUBLISHED'
and x.inventory_item_id = i.inventory_item_id
and i.inventory_item_id = mtl_system_items_b_kfv.inventory_item_id
and i.organization_id = mtl_system_items_b_kfv.organization_id
and x.minisite_id = :4
and x.organization_id =:5
order by nearness desc ) WHERE rownum < :6
))T
where rownum where row_num >= :8
Product Search (Category Search - R12)
select * from
(select T.*, RowNum as row_num
from (select inventory_item_id INVENTORY_ITEM_ID
,description DESCRIPTION
,category_id CATEGORY_ID
,nearness NEARNESS
,concatenated_segments CONCATENATED_SEGMENTS
,primary_uom_code PRIMARY_UOM_CODE
,primary_unit_of_measure PRIMARY_UNIT_OF_MEASURE
from (select i.inventory_item_id, i.description, i.category_id
,score(100) nearness
,mtl_system_items_b_kfv.concatenated_segments
,mtl_system_items_b_kfv.primary_uom_code
,mtl_system_items_b_kfv.primary_unit_of_measure
from ibe_ct_imedia_search i,
mtl_system_items_b_kfv
where contains (i.indexed_search, :1 , 100) > 0
and i.language = userenv('LANG')
and i.web_status='PUBLISHED'
and i.organization_id = :3
and exists (select 1
from ibe_dsp_section_items s,ibe_dsp_msite_sct_items b
where s.section_item_id = b.section_item_id
and b.mini_site_id = :4
and s.inventory_item_id = i.inventory_item_id
and (s.end_date_active > sysdate or s.end_date_active is null)
and s.start_date_active < sysdate)
and rownum < :5
and i.inventory_item_id = mtl_system_items_b_kfv.inventory_item_id
and i.organization_id = mtl_system_items_b_kfv.organization_id
order by nearness desc ))T
where rownum where row_num >= :7
Regards,
Debbie -
Promote results with exact match to the query text
Hi,
i want to promote to top results where there is exact match to the query text (not results that were found thanks to "Enable stemming" and morphology). Any ideas? maybe a query rule?
keren tsurCheck if below can help
http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/05/13/wildcard-search-web-part-for-sharepoint-2010.aspx -
Hi Guys,
First of all thanks in advance any help much appriciated.
I am new in scripting and excel, i am looking for below solution as my job requires daily work of this kind and i came to know by automating this work lots of time can be saved.
Compare Server Names in Excel sheet from column1 with column 2 and exact matched server names should be saved in column 3 in same Excel sheet.
Looking solutions first using excel i.e.vlookup itself so that it will not require any approval in my job else using powersell ,vbscript.
Once again Thanks for you guys.
/Regards
Nitesh24inHi Edward,
Thanks once again
I have only changed excel file path and after that this is saved as below , i am not sure which three lines should be together in one line. Please advise.
$excel = New-Object -ComObject Excel.Application
$Workbook = $excel.Workbooks.Add("F:\NewDocsToReadNitesh26-May2013\Excel\test.xls")
$WorkSheet = $Workbook.Worksheets.Item(1)
$WorkSheet.Activate() | Out-Null
For ($i=1;$i -le $worksheet.UsedRange.Rows.Count;$i++) {
If ($worksheet.cells.item($i,1).value2 -eq $worksheet.cells.item($i,2).value2) {
$worksheet.cells.item($i,3).value2 = $worksheet.cells.item($i,1).value2
}$Workbook.Save()$excel.Quit()[System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$excel) | Out-Null
Thanks and Regards
Nitesh24in -
Open item Settlement for exact match.
Hi All,
We have requirement in our project to clear the exact match first ahead of the oldest due debt.
To elaborate on the requirement, please have a look at the following example.
1st Invoice -$100 Due date-1/11/2010
2nd Invoice-$250 Due date-1/12/2010
Customer makes a payment of $250 on 10/12/2010.
As per our requirement, It should clear the 2nd Invoice first, as it gets an exact match and not the oldest debt due.
However, if the customer makes a payment of say $300, then it does not find any exact match and hence will clear the oldest due first.In this case,the 1st invoice.
In the clearing Step under the clearing variant , we have tried to use the Amount rule as '0'-Clearing only possible when amounts are same.....but it is not working as per our requirement.
Can any one of you give any thoughts on the issue?
Thanks,
AmlanHi - tried this config, and I cleared an open item based on exact amount, that was due later that 2 other items. See below.
Ivor Martin
Clearing Var. ZEX Exact matching test
Clearing Step 1 Exact match on amount
Char. Grpng rule Sort charact. Rank Sort
1. 013 Open Amount Without In 1.
2. 2.
3. 3.
4. 4.
5. 5.
Amount Rule 0
Clearing rule Paymt rem. var. ZEX / 2
End of assgmt
/ 0
Clearing Step 2 Oldest due date
Char. Grpng rule Sort charact. Rank Sor
1. 015 Contract Account 1. 010 Due date
2. 2.
3. 3.
4. 4.
5. 5.
Amount Rule
Clearing rule Paymt rem. var. / 0
End of assgmt 9
/ 0
Maybe you are looking for
-
Hello all When I play a video on the n85 it runs perfectly. When I connect the device to the tv-out and from there to the screen the video is very choppy on the n85 and on the screen it's not as smooth as usually... on the same screen, video-file and
-
<c:out/> is not working i don't know why ? i get the output as ${myname} instead of jayaraj can any one help me ? thanks in advance <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <html> <head> <title>Insert title here</title> </head
-
Labview – embedded - part time (Homeworking)
£20ph -3mc - 2 days a week - Home working Labview – embedded - part time A part time Labview, engineer is required immediately for a home working role for 2 days a week on a 3 month contract. The candidate would be required to be testing hardware usi
-
Transaction key - accounting key - ESA, ESE, VSE
Dear, Pls give valuable opinion, how the system capture the appropriate transaction key while we doing migo or miro. for example. in miro , the condition type are JSVD,JEC4,JES4 and its a/c keys are ESA,ESE,VSE respectively. pls tell me, when i do
-
SCCM 2012 Query to list all office 2010 x86 architectures systems
Hi, I am trying to find all the x86 versions of office 2010 in one query to install a x86 application to and all the x64 versions of office 2010 in another query to install an x64 application to, i got the x64 to work its just that my x86 query picks