search 相关问题

关于搜索算法机制和实现的问题。 * NOT *有关在API中使用搜索工具的问题(例如Google,Bing,Facebook)。

urlSearchParams 未更新 url

我正在尝试将搜索和页面添加到我的网址中,以便在页面上进行搜索和分页。 const urlParams = new URLSearchParams(window.location.search); if(!urlParams.has('搜索'){ urlParams.append('

回答 2 投票 0

SwiftUI TextEditor 视图在 Mac OSX 上无法搜索?

第一次在 MacOSX 中使用文本编辑器 根据这个: https://www.hackingwithswift.com/quick-start/swiftui/how-to-let-users-find-and-replace-text 结构ContentView:视图{ @State var 文本...

回答 1 投票 0

使用 Azure“功能代码搜索”如何查找短语

我正在谈论https://learn.microsoft.com/en-us/azure/devops/project/search/function-code-search?view=azure-devops 我想找到字符串“this.Data =”(不带引号)。那个...

回答 1 投票 0

BTS - 二叉树搜索

我正在尝试用 java 创建我的第一个 BTS,但我的代码遇到了一些问题: 我需要创建用于添加项目和从树中删除项目的方法。 这是我写的: @覆盖 公开

回答 1 投票 0

如何在电子商务网站的搜索栏中实现正则表达式(动态搜索)

我希望如果有人在应用程序中搜索查询,那么如果查询拼写错误,那么它会自动理解密钥 我尝试用正则表达式来做到这一点,但如果我搜索(“后退”)那么根据......

回答 1 投票 0

在 VS Code 文件搜索中,我可以展开(或折叠)所有结果吗?

在程序的“搜索”窗格中,按 Enter 键后,会列出所有文件,其中一些文件会展开以显示文件中的结果,而其他文件则会折叠。我首先想知道是什么决定了...

回答 2 投票 0

使用 Excel VBA 在 n 个 Outlook 文件夹中查找来自 x 的电子邮件

我正在使用 Excel VBA 在 n 个 Outlook 文件夹中查找来自 x 的电子邮件。 我想要 n 个结果(或更多文件夹)中的最新项目。 我考虑合并n个对象,按ReceivedTi排序...

回答 2 投票 0

SQLite 中的近似匹配搜索

参见此表: 我想使用近似匹配搜索 例如 当我搜索“ففه”这个词时,它会显示“ففه”的记录 依此类推,“??”它向我显示“??”的记录 我不想...

回答 1 投票 0

Visual Studio 17.9 中的“转到当前文件中的方法”功能现已缺失(回归)

自 Visual Studio 17.9 起,Microsoft 删除了在当前文件中查找方法或成员的可能性。 或者我错过了什么? 在以前的 Visual Studio 中,我可以这样做: Ctrl+T...

回答 1 投票 0

算法即时搜索细化列表项在搜索其他内容时切换

我有一个问题,当您进行搜索时,从细化列表中选择一个项目,并且不删除所选项目搜索其他内容,由于...

回答 2 投票 0

判断一棵树是否是图的 BFS 树

给定一个无向图和一棵树(表示为父数组),如何确定是否可以通过在给定图上应用广度优先搜索来生成给定树?有具体的吗

回答 1 投票 0

在自定义搜索中包含高级自定义字段 (ACF) - WordPress

我已经通过我的博客的指定类别创建/混合了一个很酷的搜索。使用 Ajax 加载结果而无需重新加载。 当我搜索时 - 无论我搜索什么词。我全部收到了

回答 2 投票 0

如何在不使用 JavaScript 的情况下更新 Flask 模板中的变量?

我正在尝试使用 Flask 制作一个图书馆管理项目,并具有书籍搜索功能。 参考图片 如果我在搜索框中输入一些内容,我只想查看那些书。 她...

回答 1 投票 0

基于同一个表的行和列中的多个条件查找值

我想在 E 列和 F 列中创建一个公式,用于确定特定 CALL 类型 ROWS 上的代理和护士。 例子: 我在此示例中有 2 个呼叫(呼叫 ID:12345 和 67890)。 T...

回答 1 投票 0

Google 自定义/可编程搜索:“服务器:ESF”

我写了一个小Python程序,在https://customsearch.googleapis.com/customsearch/v1上发出Google自定义/可编程API搜索查询 程序运行良好;没有问题。 然而,当

回答 1 投票 0

搜索功能不过滤回原始数据

如果我们在搜索栏中搜索任何文本……我们会得到过滤后的搜索结果……但问题是所有其他待办事项都消失了.. 我无法回到所有其他待办事项.. 搜索功能代码 李...

回答 2 投票 0

带有 contains 的 WPF 组合框文本搜索

我如何使用 contains 而不是 StartsWith 来实现我的 Combobox TextSearch 我如何使用 contains 而不是 StartsWith 来实现我的组合框文本搜索 <rf:ComboBox Grid.Row="1" Grid.Column="5" Width="200" ItemsSource="{Binding Source={StaticResource AccountProvider}}" DisplayMemberPath="Description" SelectedValuePath="IndRekId" IsEmptyItemVisible="True" SelectedValue="{Binding Id, UpdateSourceTrigger=PropertyChanged}" IsTextSearchEnabled="True" TextSearch.TextPath="Description" IsEditable="True"/> 搜索功能可以工作,但我需要匹配子字符串 这里我有一个MVVM框架的例子。 我的xaml文件: <ComboBox Name="cmbContains" IsEditable="True" IsTextSearchEnabled="false" ItemsSource="{Binding pData}" DisplayMemberPath="wTitle" Text="{Binding SearchText ,Mode=TwoWay}" > <ComboBox.Triggers> <EventTrigger RoutedEvent="TextBoxBase.TextChanged"> <BeginStoryboard> <Storyboard> <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="IsDropDownOpen"> <DiscreteBooleanKeyFrame Value="True" KeyTime="0:0:0"/> </BooleanAnimationUsingKeyFrames> </Storyboard> </BeginStoryboard> </EventTrigger> </ComboBox.Triggers> </ComboBox> 我的cs文件: //ItemsSource - pData //There is a string attribute - wTitle included in the fooClass (DisplayMemberPath) private ObservableCollection<fooClass> __pData; public ObservableCollection<fooClass> pData { get { return __pData; } set { Set(() => pData, ref __pData, value); RaisePropertyChanged("pData"); } } private string _SearchText; public string SearchText { get { return this._SearchText; } set { this._SearchText = value; RaisePropertyChanged("SearchText"); //Update your ItemsSource here with Linq pData = new ObservableCollection<fooClass>{pData.ToList().Where(.....)}; } } 您可以看到可编辑的组合框绑定到字符串(SearchText) 一旦发生 TextChanged 事件,就会显示下拉菜单,并且双向绑定会更新值。 当进入 set{} 时,cs 文件中的 ItemsSource 发生了变化;语法。 https://gist.github.com/tonywump/82e66abaf71f715c4bd45a82fce14d80 这个示例看起来像“TextSearch” 在 XAML 文件中,您应该只向组合框“TextContainSearch.Text”添加一个属性: <ComboBox ItemsSource="{Binding Model.formListIntDeviceNumbers}" SelectedItem="{Binding Path=Model.selectedDeviceNumber, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" DisplayMemberPath="DeviceNumber" IsEditable="True" c:TextContainSearch.Text="DeviceNumber"> 我们应该在 XAML 文件的标头中添加 using : xmlns:c="clr-namespace:Adaptive.Controls.Extension" *.cs 文件中的 C# 代码: using System; using System.Windows; using System.Windows.Controls; namespace Adaptive.Controls.Extension { public sealed class TextContainSearch : DependencyObject { public static void SetText(DependencyObject element, string text) { var controlSearch = element as Control; if (controlSearch != null) controlSearch.KeyUp += (sender, e) => { if (sender is ComboBox){ var control = sender as ComboBox; control.IsDropDownOpen = true; var oldText = control.Text; foreach(var itemFromSource in control.ItemsSource){ if (itemFromSource != null) { Object simpleType = itemFromSource.GetType().GetProperty(text).GetValue(itemFromSource, null); String propertOfList = simpleType as string; if (!string.IsNullOrEmpty(propertOfList) && propertOfList.Contains(control.Text)) { control.SelectedItem = itemFromSource; control.Items.MoveCurrentTo(itemFromSource); break; } } } control.Text = oldText; TextBox txt = control.Template.FindName("PART_EditableTextBox", control) as TextBox; if (txt != null) { txt.Select(txt.Text.Length, 0); } } }; } } } 试试这个: <ComboBox Padding="3,5" MinWidth="150" SelectedItem="{Binding NewBoxRequest}" ItemsSource="{Binding Requests}" DisplayMemberPath="SN" IsEditable="True" StaysOpenOnEdit="True" Text="{Binding SnFilter,UpdateSourceTrigger=PropertyChanged}"> </ComboBox> 查看型号: private string snFilter; public string SnFilter { get { return snFilter; } set { snFilter = value; RaisePropertyChanged(); RaisePropertyChanged(nameof(Requests)); } } private List<Request> requests; public List<Request> Requests { get => string.IsNullOrEmpty(SnFilter) || requests.Any(r => r.SN == SnFilter) ? requests : requests.Where(r => r.SN.Contains(SnFilter)).ToList(); set { requests = value; RaisePropertyChanged(); } } 无法用 string.Contains() 替换 string.StartsWith()。您必须编写自定义组合框。 这篇文章可能会帮助您: http://www.codeproject.com/Tips/631196/ComboBox-with-Suggest-Ability-based-on-Substring-S 我无法让“Set”语法在我的 C# 系统中工作,所以这里是对上面 Wu 的答案的一个小起飞(这是在自定义控件中): <ComboBox IsEditable="True" IsTextSearchEnabled="false" ItemsSource="{Binding pData, RelativeSource = {RelativeSource TemplatedParent}}" DisplayMemberPath="description" Text="{Binding SearchText , RelativeSource = {RelativeSource TemplatedParent}, Mode=TwoWay}" > <ComboBox.Triggers> <EventTrigger RoutedEvent="TextBoxBase.TextChanged"> <BeginStoryboard> <Storyboard> <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="IsDropDownOpen"> <DiscreteBooleanKeyFrame Value="True" KeyTime="0:0:0"/> </BooleanAnimationUsingKeyFrames> </Storyboard> </BeginStoryboard> </EventTrigger> </ComboBox.Triggers> </ComboBox> 在自定义控件中: private async void _Loaded(object sender, RoutedEventArgs e) { var n = await InitializeLabTests; allTests = new ObservableCollection<CommonProcedure>(n); pData = new ObservableCollection<CommonProcedure>(n); } //ItemsSource - pData //There is a string attribute - wTitle included in the fooClass (DisplayMemberPath) private ObservableCollection<CommonProcedure> __pData; public ObservableCollection<CommonProcedure> pData { get { return __pData; } set { __pData = value; RaisePropertyChanged(); } } private string _SearchText; public string SearchText { get { return _SearchText; } set { _SearchText = value; RaisePropertyChanged(); //Update your ItemsSource here with Linq pData = new ObservableCollection<CommonProcedure> ( allTests.Where(q => q.description.Contains(SearchText)) ); } } 唯一显着的区别在于 SearchText 设置器。 ComboBox KeyUp 事件上的动态事件怎么样: <ComboBox DisplayMemberPath="Label" Height="37" Padding="5" SelectedValue="{Binding Client, UpdateSourceTrigger=PropertyChanged}" ItemsSource="{Binding ClientList, UpdateSourceTrigger=PropertyChanged }" IsEditable="True" TextSearch.TextPath="Label" KeyUp="ComboBox_KeyUp" /> 活动: private void ComboBox_KeyUp(object sender, KeyEventArgs e) { var control = sender as ComboBox; if (control == null) { return; } if (control.Tag == null) { control.Tag = control.ItemsSource as List<ComboBoxItemViewModel>; } var filter = control.Text.ToLower(); if (filter.Length == 0) { // If no text, show all items control.ItemsSource = control.Tag as List<ComboBoxItemViewModel>; } else { var dataSource = control.Tag as List<ComboBoxItemViewModel>; if (dataSource == null) return; // Filter items based on the text entered control.ItemsSource = dataSource.Where(item => item.Label.ToLower().Contains(filter)).ToList(); } } //Just replace the List<ComboBoxItemViewModel> with your ViewModel

回答 6 投票 0

根据多个属性过滤js对象数组

(使用react js)我正在尝试过滤这个数组: [ {gov:"A1", 区:"1" , 城镇:"t1", type:"汽车工厂"}, {政府:“A2”,区:“2”...

回答 1 投票 0

Postgres 查询包含非字母字符

我正在开发在 Postgres 数据库中按名称搜索实体的功能。名称通常由 1-3 个单词组成,可能包含 &、!、(、)、- 等符号。 我正在使用杜松子酒三元组索引和查询:WHERE ...

回答 1 投票 0

带有按钮表单字段的 HTML 输入搜索字段

我有一个带有按钮的输入搜索字段,希望在输入查询时与我的 html 页面进行交互,用户在页面搜索字段中输入的歌曲让它播放...

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.