question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to show search?

See original GitHub issue

I want to construct a simple hello world search example application, but the README does not show how one is supposed to actually show the search. How can I tell itemsjs where my container is so that it is shown?

I cannot follow the examples because they all use external frameworks like Vue and React, which I don’t.

Is it impossible to use itemsjs without Vue and React?

At https://jsfiddle.net/wnhao0qc/1/ is my example:

HTML

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">		
		<script src="https://unpkg.com/itemsjs@latest/dist/itemsjs.min.js"></script>	
	</head>
	<body onload="main();">
	</body>
</html>

JavaScript

const config = {
  sortings: {
    bezeichnung: {
      field: 'id',
      order: 'asc'
    }
  },
  aggregations: {
    tags: {
      title: 'begriffsklasse',
      size: 3
    }
  },
  searchableFields: ['id', 'synonyme','definition','begriffsklasse']
};

const data = [
{id: "id1", name: "peter"},
{id: "id2", name: "bob"},
{id: "id3", name: "alice"}
];

function main()
{
  itemsjs = itemsjs(data, config);
  const search = itemsjs.search(); // <<<<<<<<<<------- this should create the search UI but nothing happens, the screen is blank
  console.log(search);
}

The problem is that itemsjs.search() does nothing, which is understandable, because I didn’t point it to a rendering container. What do I to do to show it?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
Ruitjescommented, Dec 2, 2021

Hello @KonradHoeffner and @cigolpl,

We created an adapter to link Itemjs with Instantsearch, I think this is a solution to your problem! https://github.com/unplatform-io/instantsearch-itemsjs-adapter

2reactions
cigolplcommented, Dec 3, 2021

@Ruitjes I’ve put a gif of your demo on the main page. I am aware that maybe it’s not 100% ready but it is already more functional than previous demo and it has code so it is easy to start with it a new project or learn Instantsearch. We can update this gif at any time in the future if there will be a need

Read more comments on GitHub >

github_iconTop Results From Across the Web

Search for anything, anywhere - Microsoft Support
To get search results from your PC and the web, tap or click the search icon , and type what you're looking for...
Read more >
Is the Windows 10 Search bar missing? 6 ways to show it
To get the Windows 10 Search bar back, right-click or press-and-hold on an empty area on your taskbar to open a contextual menu....
Read more >
Windows 10 - Enable/Disable Search Box - YouTube
Windows 10 - Enable/Disable Search Box While the search box in Windows 10 can be convenient, sometimes it might take up too …...
Read more >
Hide and Show Search Box on Taskbar in Windows 10
After entering Taskbar and Start Menu Properties, open Toolbars, click the down arrow, choose Show search box from the options and hit OK....
Read more >
Windows 10 Search Bar Missing? Here Are 6 Solutions
Right-click the Taskbar and then click Cortana to choose Show search box. enable the search bar from Cortana's settings. After you finish the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found